hisyam fs
/
cmps12lib
test
main.cpp@5:c39f2e572384, 2019-03-21 (annotated)
- Committer:
- hisyamfs
- Date:
- Thu Mar 21 14:26:29 2019 +0000
- Revision:
- 5:c39f2e572384
- Parent:
- 3:892567359899
nambahin erase profile di main
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hisyamfs | 0:5cf249ca41f0 | 1 | #include "mbed.h" |
hisyamfs | 3:892567359899 | 2 | #include "CMPS_KRAI.h" |
hisyamfs | 0:5cf249ca41f0 | 3 | |
hisyamfs | 3:892567359899 | 4 | CMPS_KRAI cmps12(PB_4, PA_8, 0xC0); |
hisyamfs | 0:5cf249ca41f0 | 5 | Serial pc(USBTX, USBRX); |
hisyamfs | 0:5cf249ca41f0 | 6 | |
hisyamfs | 3:892567359899 | 7 | int main() { |
hisyamfs | 5:c39f2e572384 | 8 | cmps12.eraseProfile(); |
hisyamfs | 3:892567359899 | 9 | while (1) { |
hisyamfs | 3:892567359899 | 10 | int deg = cmps12.readBearing(); |
hisyamfs | 5:c39f2e572384 | 11 | int status = cmps12.state(SYSTEM_STATE); |
hisyamfs | 5:c39f2e572384 | 12 | pc.printf("%d %d\n", deg, status); |
hisyamfs | 3:892567359899 | 13 | wait_ms(200); |
hisyamfs | 3:892567359899 | 14 | pc.printf("\033[2J\033[H"); |
hisyamfs | 0:5cf249ca41f0 | 15 | } |
hisyamfs | 0:5cf249ca41f0 | 16 | } |