This program is prototype for getting direction.

Dependencies:   mbed

Fork of groundsensor by cansat-d_2018

Committer:
394
Date:
Fri Oct 19 11:07:21 2018 +0000
Revision:
1:9471418ea8d7
Parent:
0:a7b4276743ef
prototype

Who changed what in which revision?

UserRevisionLine numberNew 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 }