Carlo Collodi / kangaroo

Dependencies:   QEI mbed

Revision:
53:978b7fa74080
Parent:
50:510ce69c2a10
Child:
54:17ea4b3c80de
--- a/src/kangaroo.cpp	Mon Dec 02 00:00:01 2013 +0000
+++ b/src/kangaroo.cpp	Mon Dec 02 05:16:26 2013 +0000
@@ -10,24 +10,23 @@
 void Kangaroo::zero(){
     m1.start();
     m2.start();
-    //m1.setVel(-.2);//wait for the legs to go to stopping points
-    //m2.setVel(-.2);
     
-    m1.setPos(3.1415/5);
-    m2.setPos(3.1415/5);//bring legs to hard stop
+    //m1.setVel(.3);//use in final
+    m2.setVel(5);
+    //m2.setPos(3.1415/5);//bring legs to hard stop
     
     led4=1;
-    wait(1.0);
+    wait(5.0);
     
     //m1.zero();
     //m2.zero();
-    m1.calibAngle(0);
-    m2.calibAngle(2*3.1415/3);
+    m1.calibAngle(0.0);
+    m2.calibAngle(2.44);
     
     wait(1);
     
-    m1.setPos(-3.1415/2);
-    //m2.setPos(3.1415/2);
+    //m1.setPos(-3.1415/2);
+    m2.setPos(3.1415/2);
     
     enc1.reset();
     enc2.reset();
@@ -51,7 +50,7 @@
 void Kangaroo::testEncoders(Serial &pc){
     //pc.printf("hello world\n");
     //pc.printf("x: %f   y: %f\n", getPoint().x, getPoint().y);
-    pc.printf("motor1:  %i  motor2:  %i\n",m1.getPos(), m2.getPos());
+    pc.printf("desir:  %f  motor2:  %i\n",m2.dAngle, m2.getPos());
     //pc.printf("clix1:  %i, rots1: %i\n",enc1.getPulses(), enc1.getRevolutions());
     
     //pc.printf("motor2:  %i\n",);