Six crescent shaped legs

Dependencies:   mbed

Revision:
5:7f800f61cb13
Parent:
4:4d54794b99a5
Child:
6:9f9047ca4a89
diff -r 4d54794b99a5 -r 7f800f61cb13 main.cpp
--- a/main.cpp	Tue Mar 29 14:33:57 2016 +0000
+++ b/main.cpp	Tue Mar 29 14:59:13 2016 +0000
@@ -7,10 +7,11 @@
 
 Encoder e(PA_0, PA_1);
 //PIDController ec(0.2, 0.1, 0.01);
-//PIDController ec(0.3, 2.0, 0.02);
+PIDController ec(0.3, 2.0, 0.02);
 //PIDController ec(0.75, 2.0, 0.015);
-PIDController ec(0.8, 1.5, 0.017);
-EncoderMotor m(PB_0, PC_1, PC_0, e, ec);
+//PIDController ec(0.8, 1.5, 0.017);
+PIDController ecRot(5.0, 0.1, 0.04);
+EncoderMotor m(PB_0, PC_1, PC_0, e, ec, ecRot);
 //Motor m(PB_0, PC_1, PC_0);
 
 void rise()
@@ -32,10 +33,15 @@
     
     m.setup();
     
+    float rot;
+    
     while(1)
     {
         //pc.printf("%d %f %f\n", e.getCount(), m.speed, m.out);
         //wait(0.1);
-        pc.scanf("%f %f %f", &ec.Kp, &ec.Ki, &ec.Kd);
+        //pc.scanf("%f %f %f", &ec.Kp, &ec.Ki, &ec.Kd);
+        //pc.scanf("%f %f %f %f", &ecRot.Kp, &ecRot.Ki, &ecRot.Kd, &rot);
+        pc.scanf("%f", &rot);
+        m.rotate(rot);
     }
 }
\ No newline at end of file