CanSat-C 2021 / Mbed 2 deprecated CanSat-C

Dependencies:   mbed HMC6352 US015 TB6612FNG2 getGPS ATP3011

Revision:
7:8fab045d2616
Parent:
6:1cda8471adc3
Child:
8:5fe1b4bbd108
--- a/main.cpp	Sun Oct 24 13:48:07 2021 +0000
+++ b/main.cpp	Tue Oct 26 07:19:24 2021 +0000
@@ -11,6 +11,10 @@
 #include "FrontGet.h"
 #include "MotorDriver.h"
 
+// フライトピン・ニクロム線関係
+Serial pc(SERIAL_TX, SERIAL_RX);
+DigitalIn flight_pin(A0);
+DigitalOut nichrome(D13);
 
 int main() {
     // 変数宣言
@@ -23,8 +27,18 @@
     double next_CP_x, next_CP_y;
     
     // 落下検知
+    // パラシュート分離
+        wait(3);//電源ついてから3v3が安定するまで、秒数は適当、必要かもわからん
+        while(flight_pin){}
+        pc.printf("flight_pin nuketa");
+        wait(35);//ピン抜けてから地面につくまで70m/2.8(m/s)=25(s)余裕を見て+10s
+        nichrome=1;
+        pc.printf("nichrome in");
+        wait(30);
+        nichrome=0;
+    // 落下終了
     
-    // パラシュート分離
+    
 
     // 行動フロー開始
     last_num = sizeof(CPs_x) / sizeof(double) - 1;  // ゴール地点のインデックスを算出