6. Zumo Shield Arduino library

Our Zumo Shield Arduino library makes 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 library’s GitHub page. The Zumo Shield Arduino library documentation provides detailed information about the library, and the library comes with several example sketches.

If you are using version 1.6.2 or later of the Arduino software (IDE), you can use the Library Manager to install this library:

  1. In the Arduino IDE, open the “Sketch” menu, select “Include Library”, then “Manage Libraries…”.
  2. Search for “ZumoShield”.
  3. Click the ZumoShield entry in the list.
  4. Click “Install”.

If this does not work, you can manually install the library:

  1. Download the latest release archive from GitHub and decompress it.
  2. Rename the folder “zumo-shield-arduino-library-master” to “ZumoShield”.
  3. Move the “ZumoShield” folder into the “libraries” directory inside your Arduino sketchbook directory. You can view your sketchbook location by opening the “File” menu and selecting “Preferences” in the Arduino IDE. If there is not already a “libraries” folder in that location, you should make the folder yourself.
  4. After installing the library, restart the Arduino IDE.

After you install the ZumoShield library, you can learn more about it by trying the included example sketches and by reading the Zumo Shield Arduino library documentation.

The Zumo Shield Arduino library includes the following parts:

ZumoMotors

ZumoMotors 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 A-Star 32U4 Prime, Arduino Leonardo, Arduino 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 Section 3 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 assembly instructions), you can simply call flipLeftMotor(true) and/or flipRightMotor(true) to make the motors behave consistently with the directions in your code.

ZumoBuzzer

ZumoBuzzer provides functions that allow various sounds to be played on the buzzer of the Zumo Shield, from simple beeps to complex tunes. (See Section 3 for more details about the buzzer and Section 3.c for an explanation of the buzzer control jumper settings.)

ZumoBuzzer is fully compatible with the OrangutanBuzzer functions in the Pololu AVR C/C++ Library, so any melodies written for OrangutanBuzzer functions will also work with ZumoBuzzer functions.

ZumoReflectanceSensorArray

ZumoReflectanceSensorArray provides a set of functions for reading reflectance values from a Zumo reflectance sensor array. See Section 2.c for more information on the Zumo reflectance sensor array.

This depends on QTRSensors. The ZumoReflectanceSensorArray class is a subclass of QTRSensorsRC. The functions provided by QTRSensorsRC can also be used on the ZumoReflectanceSensorArray class, and are documented in the Arduino Library for the Pololu QTR Reflectance Sensors document.

The library also includes copies of several other Arduino libraries:

L3G

L3G interfaces with L3G family of gyros. It makes it simple to read the raw gyro data.

LSM303

LSM303 interfaces with the LSM303 family of 3D compass and accelerometer ICs. It makes it simple to read the raw accelerometer and magnetometer data

QTRSensors

QTRSensors interfaces with Pololu QTR reflectance sensors. Since the Zumo reflectance sensor array has the same interface as the QTR RC reflectance sensors, the ZumoReflectanceSensorArray library uses QTRSensors to read the sensor array.

PololuBuzzer

PololuBuzzer enables playing notes and songs on a buzzer. For boards based on the ATmega328P, this library uses Timer 2 and pin 3 (PD3/OC2B). For boards based on the ATmega32U4, this library uses Timer 4 and pin 6 (PD7/OC4D). This library will conflict will other libraries that use the same timer or pin.

Pushbutton

Pushbutton 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.

Related Products

Zumo Shield for Arduino
Zumo Robot Kit for Arduino (No Motors)
Zumo Reflectance Sensor Array
Zumo Robot for Arduino (Assembled with 75:1 HP Motors)
Zumo Shield for Arduino, v1.2
Zumo Robot Kit for Arduino, v1.2 (No Motors)
Zumo Robot for Arduino, v1.2 (Assembled with 75:1 HP Motors)
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors