3/18/2019
Grove - 3-Axis Digitial Compass v2.0 - Seeed Wiki
http://wiki.seeedstudio.com/Grove-3-Axis_Digitial_Compass_v2.0/
7/15
Software
Studio/Grove_3_Axis_Compass_V2.0_BMM150]
[http://wiki.seeedstudio.com/How_to_install_Arduino_Library]
to install library for
Arduino.
Step 3. Create a new Arduino sketch and paste the codes below to it or open the
code directly by the path: File->Examples-
>Grove_3_Axis_Compass_V2.0_BMM150-master->compass
Here is the code
Please plug the USB cable gently, otherwise you may damage the interface.Please use the USB
cable with 4 wires inside, the 2 wires cable can't transfer data. If you are not sure about the wire
you have, you can click
[https://www.seeedstudio.com/Micro-USB-Cable-48cm-p-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* This example
*/
#include
<Arduino.h>
#include
<Wire.h>
// libraries
#include
"bmm150.h"
#include
"bmm150_defs.h"
BMM150 bmm = BMM150();
void
setup
()
{
Serial.begin(
9600
);
if
(bmm.initialize() == BMM150_E_ID_NOT_CONFORM) {
Serial.println(
"Chip ID can not read!"
);
while
(
1
);
}
else
{
Serial.println(
"Initialize done!"
);
}