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.
Diff: src/dynamics.cpp
- Revision:
- 25:8a34b8d6cc6e
- Parent:
- 23:112c0be5a7f3
- Child:
- 26:53b793b7a82f
--- a/src/dynamics.cpp Tue Nov 19 19:12:42 2013 +0000 +++ b/src/dynamics.cpp Tue Nov 19 20:42:01 2013 +0000 @@ -1,3 +1,25 @@ #include "mbed.h" #include "include/dynamics.hpp" +#include "include/motor.hpp" +Kangaroo::Kangaroo(Motor M1, Motor M2, QEI e1, QEI e2):m1(M1),m2(M2),enc1(e1),enc2(e2){ + +} + +Kangaroo::zero(){ + m1.setVel(-.002);//wait for the legs to go to stopping points + m2.setVel(-.002); + wait(1); + + m1.zero(); + m2.zero(); + + enc1.reset(); + enc2.reset(); + + while((enc1.getRevolutions()==0)&&(enc2.getRevolutions()==0)){ + wait(0.1); + } + + +} \ No newline at end of file