Defines | |
#define | FORWARD 1 |
make the motors go forwards | |
#define | BACKWARD 0 |
make the motors go backwards | |
Functions | |
int | motors_init (void) |
Initialize the motors. | |
int | motor_l_set (int direction, int speed) |
Set speed and direction of left motor. | |
int | motor_r_set (int direction, int speed) |
Set speed and direction of right motor. | |
int | motor1_set (int direction, int speed) |
Set speed and direction of motor1. | |
int | motor2_set (int direction, int speed) |
Set speed and direction of motor2. | |
int | motors_off (void) |
Turn the motors off. | |
Variables | |
unsigned char | motors_initd = 0 |
int 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. |
int 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. |
int motor_l_set | ( | int | direction, | |
int | speed | |||
) |
Set speed and direction of left motor.
Sets the speed and direction of the left motor. 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. |
int motor_r_set | ( | int | direction, | |
int | speed | |||
) |
Set speed and direction of right motor.
Sets the speed and direction of the right motor. 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. |
int motors_init | ( | void | ) |
Initialize the motors.
Initializes both motors so that they can be used with future calls to motor1_set and motor2_set.
int motors_off | ( | void | ) |
Turn the motors off.
Turns off both motors.