![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
This program is prototype for getting direction.
Dependencies: mbed
Fork of groundsensor by
Diff: main.cpp
- Revision:
- 0:a7b4276743ef
diff -r 000000000000 -r a7b4276743ef main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 19 09:28:10 2018 +0000 @@ -0,0 +1,13 @@ +#include "mbed.h" +#include "HMC5883L.h" + +Serial pc(USBTX, USBRX); +HMC5883L compass(p28, p27); + +int main() { + compass.init(); + while(1) { + pc.printf("raw=%f\r\n",compass.getHeadingXYDeg()); /*度数法で表記*/ + wait(0.2); + } + }