Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: R1370 SerialMultiByte
Fork of R1370sample by
main.cpp@0:f94834989686, 2018-08-24 (annotated)
- Committer:
- UCHITAKE
- Date:
- Fri Aug 24 04:38:58 2018 +0000
- Revision:
- 0:f94834989686
- Child:
- 1:022a516e4765
initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| UCHITAKE | 0:f94834989686 | 1 | #include "mbed.h" |
| UCHITAKE | 0:f94834989686 | 2 | #include "R1370.h" |
| UCHITAKE | 0:f94834989686 | 3 | |
| UCHITAKE | 0:f94834989686 | 4 | R1370 r1370(PC_10, PC_11); |
| UCHITAKE | 0:f94834989686 | 5 | Serial pc(USBTX, USBRX, 230400); |
| UCHITAKE | 0:f94834989686 | 6 | DigitalOut led1(LED1); |
| UCHITAKE | 0:f94834989686 | 7 | |
| UCHITAKE | 0:f94834989686 | 8 | // main() runs in its own thread in the OS |
| UCHITAKE | 0:f94834989686 | 9 | int main() { |
| UCHITAKE | 0:f94834989686 | 10 | while (true) { |
| UCHITAKE | 0:f94834989686 | 11 | led1 = !led1; |
| UCHITAKE | 0:f94834989686 | 12 | pc.printf("ANGLE:<%3.4fdegrees>", r1370.getAngle()); |
| UCHITAKE | 0:f94834989686 | 13 | pc.printf(" RATE:<%3.4fdegrees>", r1370.getRate()); |
| UCHITAKE | 0:f94834989686 | 14 | pc.printf(" ACC:<%4d, %4d, %4d>\r\n", r1370.getAcc('x'), r1370.getAcc('y'), r1370.getAcc('z')); |
| UCHITAKE | 0:f94834989686 | 15 | } |
| UCHITAKE | 0:f94834989686 | 16 | } |
| UCHITAKE | 0:f94834989686 | 17 |
