This program is prototype for getting direction.
Dependencies: mbed
Fork of groundsensor by
main.cpp@0:a7b4276743ef, 2018-10-19 (annotated)
- Committer:
- 394
- Date:
- Fri Oct 19 09:28:10 2018 +0000
- Revision:
- 0:a7b4276743ef
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
394 | 0:a7b4276743ef | 1 | #include "mbed.h" |
394 | 0:a7b4276743ef | 2 | #include "HMC5883L.h" |
394 | 0:a7b4276743ef | 3 | |
394 | 0:a7b4276743ef | 4 | Serial pc(USBTX, USBRX); |
394 | 0:a7b4276743ef | 5 | HMC5883L compass(p28, p27); |
394 | 0:a7b4276743ef | 6 | |
394 | 0:a7b4276743ef | 7 | int main() { |
394 | 0:a7b4276743ef | 8 | compass.init(); |
394 | 0:a7b4276743ef | 9 | while(1) { |
394 | 0:a7b4276743ef | 10 | pc.printf("raw=%f\r\n",compass.getHeadingXYDeg()); /*度数法で表記*/ |
394 | 0:a7b4276743ef | 11 | wait(0.2); |
394 | 0:a7b4276743ef | 12 | } |
394 | 0:a7b4276743ef | 13 | } |