#include "direct-motor.h"will need to called out in the source.
Each of the motor output ports can be set to one of 4 states:
| off | motors freewheel and use no power |
| fwd | forward rotation |
| rev | backward rotation |
| brake | motor shorted, uses some power |
The motor to drive is specified by the name of the function that is called out:
motor_X_speed() motor_X_dir()where X is a,b,or c
To setup and drive a motor:
/* drive motor A forward at half speed */ motor_a_speed(MAX_SPEED/2); motor_a_dir(fwd);It is quite usable to set the motor speed at initialization and then to use the direction control to turn the motors on and off as needed.
| Previous - Sensors | Main | Next - Front Panel |