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: QEI MPU6050 TB6612FNG
main.cpp@0:d6107da1cba0, 2021-05-07 (annotated)
- Committer:
- Satoshisatoshi
- Date:
- Fri May 07 03:27:43 2021 +0000
- Revision:
- 0:d6107da1cba0
AAAAAAAAAAAAAAAAAA
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Satoshisatoshi | 0:d6107da1cba0 | 1 | #include "mbed.h" |
| Satoshisatoshi | 0:d6107da1cba0 | 2 | #include "MPU6050.h" |
| Satoshisatoshi | 0:d6107da1cba0 | 3 | #include "QEI.h" |
| Satoshisatoshi | 0:d6107da1cba0 | 4 | #include "TB6612FNG.h" |
| Satoshisatoshi | 0:d6107da1cba0 | 5 | |
| Satoshisatoshi | 0:d6107da1cba0 | 6 | MPU6050 mpu1(p9,p10,0x68); |
| Satoshisatoshi | 0:d6107da1cba0 | 7 | MPU6050 mpu2(p9,p10,0x69); |
| Satoshisatoshi | 0:d6107da1cba0 | 8 | Serial pc(USBTX,USBRX); |
| Satoshisatoshi | 0:d6107da1cba0 | 9 | QEI wheel(p22, p21, NC, 12, QEI::X4_ENCODING); |
| Satoshisatoshi | 0:d6107da1cba0 | 10 | |
| Satoshisatoshi | 0:d6107da1cba0 | 11 | |
| Satoshisatoshi | 0:d6107da1cba0 | 12 | int main(){ |
| Satoshisatoshi | 0:d6107da1cba0 | 13 | while(1){ |
| Satoshisatoshi | 0:d6107da1cba0 | 14 | pc.printf("%.2f\n", ((float)wheel.getPulses())); |
| Satoshisatoshi | 0:d6107da1cba0 | 15 | pc.printf("%.2f\n", ((float)wheel.getRevolutions())); |
| Satoshisatoshi | 0:d6107da1cba0 | 16 | wait(0.1); |
| Satoshisatoshi | 0:d6107da1cba0 | 17 | } |
| Satoshisatoshi | 0:d6107da1cba0 | 18 | } |