6. Zumo Shield Arduino Libraries
Our Zumo Shield Libraries make it easy to get started writing Arduino sketches to control your Zumo. A link to
download the library and installation instructions can be found on the
.
Once installed, we recommend you try out the example sketches for each library, which can be found under
File
> Examples >
(name of the library)
, to get a better understanding of how to use the library functions.
The Zumo Shield Libraries include the following:
ZumoMotors
The ZumoMotors library provides functions for PWM-based speed (and direction) control of the two motors
on the Zumo with the onboard DRV8835 dual motor driver. On Arduinos with ATmega328P, ATmega168, and
ATmega32U4 microcontrollers (which include the Leonardo, Uno, and most older Arduinos), the motor control
functions use hardware PWM outputs from Timer1 to generate pulse width modulation at a 20 kHz frequency.
(See
for more details about the motor driver and its connections.)
If you accidentally soldered a motor to the Zumo Shield backwards (opposite the orientation indicated in
the
[http://www.pololu.com/docs/0J57/2.b]
), you can simply call
flipLeftMotor(true)
and/or
flipRightMotor(true)
to make the motors behave consistently with the directions in your code.
ZumoBuzzer
The ZumoBuzzer library provides functions that allow various sounds to be played on the buzzer of the Zumo
Shield, from simple beeps to complex tunes. (See
for more details about the buzzer and
for
an explanation of the buzzer control jumper settings.)
The ZumoBuzzer library is fully compatible with the
[http://www.pololu.com/docs/0J18/3]
functions in the
[http://www.pololu.com/docs/0J20]
, so any melodies written for
OrangutanBuzzer functions will also work with ZumoBuzzer functions.
Pushbutton
The Pushbutton library provides a set of functions that are useful for detecting and debouncing pushbutton presses.
While the most obvious application of this library is to work with the Zumo Shield’s user pushbutton on digital
pin 12, this library can be used as a general-purpose library for interfacing many types of buttons and switches to
an Arduino, even without a Zumo Shield.
Pololu Zumo Shield for Arduino User's Guide
© 2001–2012 Pololu Corporation
6. Zumo Shield Arduino Libraries
Page 24 of 28