![Pololu Zumo Shield For Arduino Скачать руководство пользователя страница 48](http://html1.mh-extra.com/html/pololu/zumo-shield-for-arduino/zumo-shield-for-arduino_user-manual_1574974048.webp)
[https://www.pololu.com/product/975]
, and the concepts and strategies involved are explained in detail in
of the
[https://www.pololu.com/docs/0J21]
7.f. Using the compass
This example program demonstrates using the magnetometer in the Zumo Shield’s LSM303 3-axis
compass module (described in section
) to help the Zumo coordinate ninety-degree
turns and drive in squares. With the
[https://www.pololu.com/docs/0J57/
installed,
the
sketch
file
can
be
opened
in
Arduino
by
selecting
File > Examples > ZumoShield > Compass
.
Because the batteries, motors, and motor current affect the z axis of the magnetometer much more
strongly than the x and y axes, this program calculates the Zumo’s orientation using only the x and y
readings from the magnetometer, assuming that the robot is always level. In order to prevent external,
locally varying magnetic fields (e.g. from rebar in a concrete floor) from affecting the Zumo’s navigation
too much, the program measures the magnetic heading before each turn, then turns ninety degrees
relative to that heading.
Pololu Zumo Shield for Arduino User’s Guide
© 2001–2019 Pololu Corporation
7. Example sketches
Page 48 of 52