Project group 3
/
mbed_cmp
The compass part
Fork of mbed_cmp by
Diff: main.cpp
- Revision:
- 0:2f8627e2b4c7
- Child:
- 1:5b42fa6e0a73
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Feb 29 15:11:21 2016 +0000 @@ -0,0 +1,18 @@ +#include "CMPS03.h" +#include "mbed.h" +CMPS03 compass(p9, p10, CMPS03_DEFAULT_I2C_ADDRESS); +Serial pc(USBTX, USBRX); + +int main() { + + pc.printf("Starting CMPS03 test...\n"); + + while(1){ + + wait(0.1); + + pc.printf("Bearing is: %f\n", compass.readBearing() / 10.0); + + } + +} \ No newline at end of file