Motors
Functions for controlling the motors. Functions for controlling the motors. Found in motor.h. More...
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 | motor_l_set (int direction, int speed) |
| Set speed and direction of left motor. | |
| void | motor_r_set (int direction, int speed) |
| Set speed and direction of right motor. | |
| 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. | |
Detailed Description
Functions for controlling the motors. Functions for controlling the motors. Found in motor.h.
Function Documentation
| 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.
- Parameters:
-
direction Either FORWARD or BACKWARD to set the direction of rotation. speed The speed the motor will run at, in the range 0-255.
- See also:
- motor2_set, motors_init
- Deprecated:
- use the left motor function instead. it's more intuitive and easier to read.
| 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.
- Parameters:
-
direction Either FORWARD or BACKWARD to set the direction of rotation. speed The speed the motor will run at, in the range 0-255.
- See also:
- motor2_set, motors_init
- Deprecated:
- use the right motor function instead. it's more intuitive and easier to read.
| void 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.
- Parameters:
-
direction Either FORWARD or BACKWARD to set the direction of rotation. speed The speed the motor will run at, in the range 0-255.
- See also:
- motor_r_set, motors_init
| void 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.
- Parameters:
-
direction Either FORWARD or BACKWARD to set the direction of rotation. speed The speed the motor will run at, in the range 0-255.
- See also:
- motor_l_set, motors_init
| 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.
- See also:
- motors_off, motor1_set, motor2_set
| void motors_off | ( | void | ) |
Generated on Thu May 17 00:00:09 2012 for libdragonfly by
1.6.1