Library to drive the Zumo shield from pololu.
Dependents: Nucleo_Zumo_BLE_IDB04A1
ZumoShield Class Reference
Zumo Shield Control Class. More...
#include <ZumoShield.h>
Public Member Functions | |
ZumoShield (PinName m1_pwm_pin, PinName m1_dir_pin, PinName m2_pwm_pin, PinName m2_dir_pin) | |
Create a Zumo shield object. | |
void | left_motor (float speed) |
Switch on the left motor at the given speed. | |
void | right_motor (float speed) |
Switch on the right motor at the given speed. | |
void | forward (float speed) |
Switch on both motors, forwards at the given speed. | |
void | backward (float speed) |
Switch on both motors, backwards at the given speed. | |
void | left (float speed) |
Switch on both motors at the given speed, in opposite directions so as to turn left. | |
void | right (float speed) |
Switch on both motors at the given speed, in opposite directions so as to turn right. | |
void | turn_left (float speed) |
Turns left. | |
void | turn_right (float speed) |
Turns right. | |
void | stop (int motor) |
Stop a chosen motor. | |
void | stopLeft () |
Stop left motor. | |
void | stopRight () |
Stop right motor. | |
void | stopAll () |
Stop both motors at the same time. |
Detailed Description
Zumo Shield Control Class.
Definition at line 5 of file ZumoShield.h.
Constructor & Destructor Documentation
ZumoShield | ( | PinName | m1_pwm_pin, |
PinName | m1_dir_pin, | ||
PinName | m2_pwm_pin, | ||
PinName | m2_dir_pin | ||
) |
Create a Zumo shield object.
- Parameters:
-
m1pwm Motor1 pwm pin m1dir Motor1 direction pin m2pwm Motor2 pwm pin m2dir Motor2 direction pin
Definition at line 4 of file ZumoShield.cpp.
Member Function Documentation
void backward | ( | float | speed ) |
Switch on both motors, backwards at the given speed.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 79 of file ZumoShield.cpp.
void forward | ( | float | speed ) |
Switch on both motors, forwards at the given speed.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 68 of file ZumoShield.cpp.
void left | ( | float | speed ) |
Switch on both motors at the given speed, in opposite directions so as to turn left.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motors.
Definition at line 56 of file ZumoShield.cpp.
void left_motor | ( | float | speed ) |
Switch on the left motor at the given speed.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 22 of file ZumoShield.cpp.
void right | ( | float | speed ) |
Switch on both motors at the given speed, in opposite directions so as to turn right.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motors.
Definition at line 62 of file ZumoShield.cpp.
void right_motor | ( | float | speed ) |
Switch on the right motor at the given speed.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 33 of file ZumoShield.cpp.
void stop | ( | int | motor ) |
Stop a chosen motor.
- Parameters:
-
motor Number, either 1 or 2 choosing the motor.
Definition at line 90 of file ZumoShield.cpp.
void stopAll | ( | ) |
Stop both motors at the same time.
Different to disable.
Definition at line 111 of file ZumoShield.cpp.
void stopLeft | ( | ) |
Stop left motor.
Definition at line 99 of file ZumoShield.cpp.
void stopRight | ( | ) |
Stop right motor.
Definition at line 105 of file ZumoShield.cpp.
void turn_left | ( | float | speed ) |
Turns left.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 44 of file ZumoShield.cpp.
void turn_right | ( | float | speed ) |
Turns right.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 50 of file ZumoShield.cpp.
Generated on Fri Jul 22 2022 05:46:13 by 1.7.2