32
Crowduino UNO-SD/Arduino UNO x1
Crowtail – Base Shield x1
Crowtail – 3-Axis Compass x1
Crowtail – Cable x1
USB Cable x1
Required Parts
STEP2:
Connect Crowtail-3-Axis Compass to Crowtail-Base shield’s I port. The complete connection
is as follows:
STEP1:
Plug the Crowtail-Base Shield onto the Arduino or Crowduino Board.
Hardware Connection
Upload the program and open the serial monitor, you can see the monitor is printing the raw values
of 3-axis, the scaled values of 3-axis and the information of compass’s radians and degrees.
What will you see
1. Import the I2C and HMC5883L compass library.
2. Create a compass instance and a variable to store errors that occur.
3. In the setup() function, initialize serial, I2C and check errors for compass.
4. Retrieve the raw values from the compass (not scaled)
5. Retrieved the scaled values from the compass (scaled to the configured scale).
Code overview
Open the downloaded folder “Crowtail-
Advanced kit for Arduino demo code”,
navigate to the folder lib-> 3Axis_Digital_-
Compass_HMC5883L, and add Digital
Compass to the Arduino library. Open the
P15_Digital_Compass
with Arduino IDE and
upload it.
Do you know what electronic module the ship's heading guidance
uses? That's right, this is the Crowtail-3-Axis Compass module that
you need to learn in this lesson. Let's start learning how to use the
Crowtail-3-Axis Compass module to make a compass.
Содержание Crowtail
Страница 48: ......