For Cansat mission mbed

Dependencies:   MU2Class RS405cb mbed myCAN_logger

Revision:
2:5871a792937b
Parent:
1:f19466574b75
Child:
4:934b39bd5c2c
--- a/main.cpp	Sat Jul 20 04:33:14 2013 +0000
+++ b/main.cpp	Sun Jul 21 07:00:11 2013 +0000
@@ -55,6 +55,8 @@
         NIKUROMU3_OFF
   
     //Sequence
+        servo.TORQUE_ON(2);
+        servo.Rotate_Servo_Float(2,-150.0);
         
         while(flightpin ==1){}
     
@@ -77,25 +79,28 @@
     
         MyMu2.send("tumehiraita\r\n");
     
-        wait(10);
+        wait(30);
     
         float theta;
         theta=-150.0;
-        servo.TORQUE_ON(3);
-        servo.Rotate_Servo_Float(3,theta);
+        servo.TORQUE_ON(2);
+        servo.Rotate_Servo_Float(2,theta);
         while(1) {
                 if(can.get_a_z()!=1){
-                    servo.TORQUE_ON(3);
-                    theta += 1.0;
-                    servo.Rotate_Servo_Float(3,theta);
+                    servo.TORQUE_ON(2);
+                    theta += 0.1;
+                    servo.Rotate_Servo_Float(2,theta);
                 }
                 else{
-                    servo.TORQUE_ON(3);
+                    servo.TORQUE_ON(2);
                     break;
                 }   
+                wait(0.006);
                 led2 = !led2;
         }
         
+        wait(20);
+        
         MyMu2.send("uemuitayo\r\n");
     
         wait(5.0);
@@ -105,6 +110,8 @@
     
         MyMu2.send("tobirahiraita\r\n");
     
+        wait(10);
+    
         wait(5.0);
         NIKUROMU3_ON
         wait(6.0);