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@6:8d2171811f14, 2016-11-11 (annotated)
- Committer:
- dlweakley
- Date:
- Fri Nov 11 06:37:24 2016 +0000
- Revision:
- 6:8d2171811f14
- Parent:
- 5:74fcd196ff96
- Child:
- 8:2abfdbf5a3b8
motor class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Snay22 | 5:74fcd196ff96 | 1 | #include "QEI.h" |
dlweakley | 6:8d2171811f14 | 2 | #include "Motor.h" |
dlweakley | 4:41bbbaecd322 | 3 | |
Snay22 | 5:74fcd196ff96 | 4 | Serial pc(USBTX, USBRX); |
Snay22 | 5:74fcd196ff96 | 5 | //Use X4 encoding. |
Snay22 | 5:74fcd196ff96 | 6 | //QEI wheel(p29, p30, NC, 624, QEI::X4_ENCODING); |
Snay22 | 5:74fcd196ff96 | 7 | //Use X2 encoding by default. |
dlweakley | 6:8d2171811f14 | 8 | QEI wheel (PTC16, PTC17, PTB9, 512); |
dlweakley | 6:8d2171811f14 | 9 | Motor motor(PTC4, PTD0, PTC3, PTC12, PTB23); |
dlweakley | 6:8d2171811f14 | 10 | |
Snay22 | 5:74fcd196ff96 | 11 | int main() { |
Snay22 | 5:74fcd196ff96 | 12 | while(1){ |
dlweakley | 6:8d2171811f14 | 13 | motor.clockwise(); |
dlweakley | 6:8d2171811f14 | 14 | |
dlweakley | 6:8d2171811f14 | 15 | motor.anticlockwise(); |
Snay22 | 5:74fcd196ff96 | 16 | pc.printf("Pulses is: %i\n", wheel.getPulses()); |
Snay22 | 0:44fc57e03a56 | 17 | } |
Snay22 | 5:74fcd196ff96 | 18 | |
Snay22 | 5:74fcd196ff96 | 19 | } |