Sample for the HMC5883L.
Fork of Seeed_Grove_Digital_Compass_Example by
Revision 1:e368e2a71ea8, committed 2018-10-03
- Comitter:
- tichise
- Date:
- Wed Oct 03 13:34:47 2018 +0000
- Parent:
- 0:74dc5ccb0b73
- Commit message:
- add
Changed in this revision
HMC5883L.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HMC5883L.lib Fri Aug 15 22:28:54 2014 +0000 +++ b/HMC5883L.lib Wed Oct 03 13:34:47 2018 +0000 @@ -1,1 +1,1 @@ -https://mbed.org/users/tylerjw/code/HMC5883L/#bc4e1201e092 +https://os.mbed.com/users/tichise/code/HMC5883L/#6a47ae8ee7ea
--- a/main.cpp Fri Aug 15 22:28:54 2014 +0000 +++ b/main.cpp Wed Oct 03 13:34:47 2018 +0000 @@ -1,8 +1,7 @@ - #include "mbed.h" #include "HMC5883L.h" - -HMC5883L compass(D14, D15); + +HMC5883L compass(p9, p10); int main(void) { @@ -15,8 +14,9 @@ compass.getXYZ(data); wait(0.1f); heading = compass.getHeadingXYDeg(); - printf("x: %4d, y: %4d, z: %4d\n", data[0], data[1], data[2]); - printf("heading: %3.2f\n", heading); + // printf("x: %4d, y: %4d, z: %4d\n", data[0], data[1], data[2]); + printf("heading: %3.0f\n", heading); wait(1.0f); } } + \ No newline at end of file