Dear all,
I looked at the lib_hb file and found the portion for motor outputs.
void motor(int m, int speed)
{
if (speed>100) speed=100;
if (speed<-100) speed=-100;
if (speed >= 0)
_set_motor(m, 0, (255*speed)/100);
else
_set_motor(m, 1, (-255*speed)/100);
}
void _set_motor(int motor, int dir, int speed)
{
bit_set(0x0e, 1 << (4 + motor)); /* turn motor on */
if (dir)
bit_set(0x0e, 1 << motor); /* set direction for backward */
else
bit_clear(0x0e, 1 << motor); /* set dir for forward */
_motor_speed[motor]= speed;
_set_motor_speeds();
}
void _set_motor_speeds()
{
int speed01= (_motor_speed[0] << 8)
+ _motor_speed[1];
int speed23= (_motor_speed[2] << 8)
+ _motor_speed[3];
pokeword(0x22, speed01);
pokeword(0x24, speed23);
}
Did anyone tried modified it from PVM to constant DC outputs?
Advice please.
Keith
|