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.
src/dynamics.cpp@25:8a34b8d6cc6e, 2013-11-19 (annotated)
- Committer:
- calamaridudeman
- Date:
- Tue Nov 19 20:42:01 2013 +0000
- Revision:
- 25:8a34b8d6cc6e
- Parent:
- 23:112c0be5a7f3
- Child:
- 26:53b793b7a82f
modified master to start integrating motors
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| calamaridudeman | 21:a9569c7b4379 | 1 | #include "mbed.h" |
| calamaridudeman | 23:112c0be5a7f3 | 2 | #include "include/dynamics.hpp" |
| calamaridudeman | 25:8a34b8d6cc6e | 3 | #include "include/motor.hpp" |
| calamaridudeman | 16:c21df8c0c458 | 4 | |
| calamaridudeman | 25:8a34b8d6cc6e | 5 | Kangaroo::Kangaroo(Motor M1, Motor M2, QEI e1, QEI e2):m1(M1),m2(M2),enc1(e1),enc2(e2){ |
| calamaridudeman | 25:8a34b8d6cc6e | 6 | |
| calamaridudeman | 25:8a34b8d6cc6e | 7 | } |
| calamaridudeman | 25:8a34b8d6cc6e | 8 | |
| calamaridudeman | 25:8a34b8d6cc6e | 9 | Kangaroo::zero(){ |
| calamaridudeman | 25:8a34b8d6cc6e | 10 | m1.setVel(-.002);//wait for the legs to go to stopping points |
| calamaridudeman | 25:8a34b8d6cc6e | 11 | m2.setVel(-.002); |
| calamaridudeman | 25:8a34b8d6cc6e | 12 | wait(1); |
| calamaridudeman | 25:8a34b8d6cc6e | 13 | |
| calamaridudeman | 25:8a34b8d6cc6e | 14 | m1.zero(); |
| calamaridudeman | 25:8a34b8d6cc6e | 15 | m2.zero(); |
| calamaridudeman | 25:8a34b8d6cc6e | 16 | |
| calamaridudeman | 25:8a34b8d6cc6e | 17 | enc1.reset(); |
| calamaridudeman | 25:8a34b8d6cc6e | 18 | enc2.reset(); |
| calamaridudeman | 25:8a34b8d6cc6e | 19 | |
| calamaridudeman | 25:8a34b8d6cc6e | 20 | while((enc1.getRevolutions()==0)&&(enc2.getRevolutions()==0)){ |
| calamaridudeman | 25:8a34b8d6cc6e | 21 | wait(0.1); |
| calamaridudeman | 25:8a34b8d6cc6e | 22 | } |
| calamaridudeman | 25:8a34b8d6cc6e | 23 | |
| calamaridudeman | 25:8a34b8d6cc6e | 24 | |
| calamaridudeman | 25:8a34b8d6cc6e | 25 | } |
