Library to drive the Zumo shield from pololu.

Dependents:   Nucleo_Zumo_BLE_IDB04A1

Embed: (wiki syntax)

« Back to documentation index

ZumoShield Class Reference

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:
m1pwmMotor1 pwm pin
m1dirMotor1 direction pin
m2pwmMotor2 pwm pin
m2dirMotor2 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:
speedThe 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:
speedThe 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:
speedThe 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:
speedThe 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:
speedThe 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:
speedThe 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:
motorNumber, 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:
speedThe 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:
speedThe speed, from 0.0 to 1.0 at which to spin the motor.

Definition at line 50 of file ZumoShield.cpp.