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/kangaroo.cpp
- Revision:
- 38:922f2584bdfd
- Parent:
- 37:bf257a0154db
- Child:
- 41:65de628f701f
--- a/src/kangaroo.cpp Sun Nov 24 20:38:59 2013 +0000 +++ b/src/kangaroo.cpp Tue Nov 26 04:42:39 2013 +0000 @@ -7,10 +7,16 @@ } void Kangaroo::zero(){ - m1.setVel(-.002);//wait for the legs to go to stopping points - m2.setVel(-.002); + m1.start(); + m2.start(); + //m1.setVel(-.2);//wait for the legs to go to stopping points + //m2.setVel(-.2); + + m1.setPos(2.0); + m2.setPos(2.0); + led4=1; - wait(1); + wait(3.0); m1.zero(); m2.zero(); @@ -24,7 +30,8 @@ led1=1; led3=1; - + m1.stop(); + m2.stop(); } void Kangaroo::testEncoders(Serial &pc){ @@ -35,4 +42,8 @@ //pc.printf("motor2: %i\n",); pc.printf("clix2: %i, rots2: %i\n",enc2.getPulses(), enc2.getRevolutions()); +} + +float Kangaroo::getAngle(){ + return (enc2.getAngle())+1.770973; } \ No newline at end of file