CanSat-C 2021
/
HMC6352_test
HMC6352の動作確認用プログラムです。
Diff: main.cpp
- Revision:
- 0:27da40c99bee
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Oct 24 11:33:44 2021 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" +#include "HMC6352.h" + +HMC6352 compass(D4, D5); +Serial pc(USBTX, USBRX); + +int main() +{ + compass.setOpMode(HMC6352_CONTINUOUS, 1, 20); + + pc.printf("\r\n\DIGITAL COMPASSS START\r\n"); + while(1) + { + wait(1); + pc.printf("Heading is: %f\n", compass.sample() / 10); + } +} \ No newline at end of file