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.
main.cpp@5:74fcd196ff96, 2016-11-11 (annotated)
- Committer:
- Snay22
- Date:
- Fri Nov 11 02:31:30 2016 +0000
- Revision:
- 5:74fcd196ff96
- Parent:
- 4:41bbbaecd322
- Child:
- 6:8d2171811f14
Test for quadrature optical encoder;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Snay22 | 5:74fcd196ff96 | 1 | #include "QEI.h" |
dlweakley | 4:41bbbaecd322 | 2 | |
Snay22 | 5:74fcd196ff96 | 3 | Serial pc(USBTX, USBRX); |
Snay22 | 5:74fcd196ff96 | 4 | //Use X4 encoding. |
Snay22 | 5:74fcd196ff96 | 5 | //QEI wheel(p29, p30, NC, 624, QEI::X4_ENCODING); |
Snay22 | 5:74fcd196ff96 | 6 | //Use X2 encoding by default. |
Snay22 | 5:74fcd196ff96 | 7 | QEI wheel (p29, p30, NC, 624); |
dlweakley | 4:41bbbaecd322 | 8 | |
Snay22 | 5:74fcd196ff96 | 9 | int main() { |
dlweakley | 4:41bbbaecd322 | 10 | |
Snay22 | 5:74fcd196ff96 | 11 | while(1){ |
Snay22 | 0:44fc57e03a56 | 12 | wait(0.1); |
Snay22 | 5:74fcd196ff96 | 13 | pc.printf("Pulses is: %i\n", wheel.getPulses()); |
Snay22 | 0:44fc57e03a56 | 14 | } |
Snay22 | 5:74fcd196ff96 | 15 | |
Snay22 | 5:74fcd196ff96 | 16 | } |