cansat program1

Dependencies:   ADXL345 BME280 HMC5883L ITG3200 MBed_Adafruit-GPS-Library XBee agzIDLIST cansat mbed

Fork of Cansat_program4_1 by CanSat2015aizu

Revision:
6:23bb3b018f44
Parent:
5:ba883a4bddc3
Child:
7:db6b436c0baa
--- a/main.cpp	Thu Aug 06 17:10:30 2015 +0000
+++ b/main.cpp	Fri Aug 07 14:35:26 2015 +0000
@@ -250,6 +250,7 @@
 ******************************/
 void standby(){
     
+    cansat.control_Motor(1, cansat.get_speed());
     if(short_in == 0){
         mode = 1;
     }
@@ -262,6 +263,7 @@
 void falling(){
     if(cansat.get_pressure() >= goal_Pressure){
         nic = 1;
+        wait_ms(10000);
         mode = 2;
     }    
 }
@@ -300,6 +302,9 @@
         }
     }
     
+    if(cansat.get_robot_x() - cansat.get_target_x() <= 0 && cansat.get_robot_y() - cansat.get_target_y() <= 0){
+        mode = 100;
+    }
 }
 
 /******************************
@@ -307,6 +312,7 @@
 ******************************/
 void stopping(){
             
+            cansat.control_Motor(0, cansat.get_speed());
             
 }