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.
Fork of QEI_HelloWorld by
main.cpp@2:f06a9b5fbeb4, 2018-08-03 (annotated)
- Committer:
- jvfausto
- Date:
- Fri Aug 03 20:29:28 2018 +0000
- Revision:
- 2:f06a9b5fbeb4
- Parent:
- 1:30696e4d196b
W/ distance
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aberk | 0:bcff39fac858 | 1 | #include "QEI.h" |
aberk | 0:bcff39fac858 | 2 | |
aberk | 0:bcff39fac858 | 3 | Serial pc(USBTX, USBRX); |
aberk | 1:30696e4d196b | 4 | //Use X4 encoding. |
aberk | 1:30696e4d196b | 5 | //QEI wheel(p29, p30, NC, 624, QEI::X4_ENCODING); |
aberk | 1:30696e4d196b | 6 | //Use X2 encoding by default. |
jvfausto | 2:f06a9b5fbeb4 | 7 | QEI wheel (D0, D1, NC, 1200); |
aberk | 0:bcff39fac858 | 8 | |
aberk | 0:bcff39fac858 | 9 | int main() { |
aberk | 0:bcff39fac858 | 10 | |
aberk | 0:bcff39fac858 | 11 | while(1){ |
aberk | 1:30696e4d196b | 12 | wait(0.1); |
jvfausto | 2:f06a9b5fbeb4 | 13 | pc.printf("Distance is: %f \r\n", wheel.getDistance(31.75)); |
jvfausto | 2:f06a9b5fbeb4 | 14 | |
aberk | 0:bcff39fac858 | 15 | } |
aberk | 0:bcff39fac858 | 16 | |
aberk | 0:bcff39fac858 | 17 | } |