Defines | |
#define | FORWARD 1 |
make the motors go forwards | |
#define | BACKWARD 0 |
make the motors go backwards | |
Functions | |
void | motors_init (void) |
Initialize the motors. | |
void | motor1_set (int direction, int speed) |
Set speed and direction of motor1. | |
void | motor2_set (int direction, int speed) |
Set speed and direction of motor2. | |
void | motors_off (void) |
Turn the motors off. |
void motor1_set | ( | int | direction, | |
int | speed | |||
) |
Set speed and direction of motor1.
Sets the speed and direction of motor1. motors_init must be called before this function can be used.
direction | Either FORWARD or BACKWARD to set the direction of rotation. | |
speed | The speed the motor will run at, in the range 0-255. |
void motor2_set | ( | int | direction, | |
int | speed | |||
) |
Set speed and direction of motor2.
Sets the speed and direction of motor2. motors_init must be called before this function can be used.
direction | Either FORWARD or BACKWARD to set the direction of rotation. | |
speed | The speed the motor will run at, in the range 0-255. |
void motors_init | ( | void | ) |
Initialize the motors.
Initializes both motors so that they can be used with future calls to motor1_set and motor2_set.
void motors_off | ( | void | ) |