
Buzzer
The
buzzer
[https://www.pololu.com/product/1484]
on the Zumo 32U4 can be used to generate simple sounds and
music. By default, it is connected to digital pin 6 (which also serves as OC4D, a hardware PWM output from
the AVR’s 10-bit Timer4). If you alternate between driving the buzzer pin high and low at a given frequency, the
buzzer will produce sound at that frequency. You can play notes and music with the buzzer using functions in
the Zumo32U4Buzzer library. If you want to use pin 6 for an alternate purpose, you can disconnect the buzzer
circuit by cutting the surface-mount jumper next to the buzzer.
3.3. Motors
Two on-board Texas Instruments DRV8838 motor drivers power the Zumo 32U4’s two micro metal gearmotors.
Four Arduino pins are used to control the drivers:
•
Digital pin 15
, or PB1, controls the
right motor direction
(LOW drives the motor forward, HIGH
drives it in reverse).
•
Digital pin 16
, or PB2, controls the
left motor direction
.
•
Digital pin 9
, or PB5, controls the
right motor speed
with PWM (pulse width modulation) generated
by the ATmega32U4’s Timer1.
•
Digital pin 10
, or PB6, controls the
left motor speed
with PWM.
For more information about the drivers, see the
DRV8838 datasheet
[https://www.pololu.com/file/download/
drv8838.pdf?file_id=0J806]
(1MB pdf). We also sell a
carrier board
[https://www.pololu.com/product/2990]
for this
driver.
The
Zumo32U4 library
[https://www.pololu.com/docs/0J63/6]
provides functions that allow you to easily control the
motors, and it can optionally take care of flipping a direction signal for you if you accidentally soldered in a
motor backwards.
As your batteries run out, the voltage supplied to the motor drivers (VBAT) will decrease, which
will make the motors slower. It is possible to account for this in your code by monitoring the
battery voltage (see
Section 3.8
) or using the encoders and other sensors to monitor the movement
of the robot.
Pololu Zumo 32U4 Robot User’s Guide
© 2001–2015 Pololu Corporation
3. The Zumo 32U4 in detail
Page 14 of 76