高高度CanSat Space SWANの投下時に使用したプログラム.(IZU2019)

Dependencies:   Nichrome_lib mbed ads1115_test BNO055_lib ADXL375_i2c ES920LR CCS811_lib SDFileSystem BME280_lib INA226_lib EEPROM_lib GPS_interrupt

Files at this revision

API Documentation at this revision

Comitter:
Sigma884
Date:
Sun Apr 21 10:37:15 2019 +0000
Parent:
7:3a2d0474f1ca
Commit message:
Space SWAN (CanSat) Main Program Ver.1

Changed in this revision

ADXL375_i2c.lib Show annotated file Show diff for this revision Revisions of this file
BME280_lib.lib Show annotated file Show diff for this revision Revisions of this file
CCS811_lib.lib Show annotated file Show diff for this revision Revisions of this file
INA226_lib.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 3a2d0474f1ca -r 2ce2c7eebb92 ADXL375_i2c.lib
--- a/ADXL375_i2c.lib	Tue Mar 12 14:12:31 2019 +0000
+++ b/ADXL375_i2c.lib	Sun Apr 21 10:37:15 2019 +0000
@@ -1,1 +1,1 @@
-ADXL375_i2c#3dd4209d304a
+https://os.mbed.com/teams/PQ_Hybrid_Electrical_Equipment_Team/code/ADXL375_i2c/#46fcf349bdca
diff -r 3a2d0474f1ca -r 2ce2c7eebb92 BME280_lib.lib
--- a/BME280_lib.lib	Tue Mar 12 14:12:31 2019 +0000
+++ b/BME280_lib.lib	Sun Apr 21 10:37:15 2019 +0000
@@ -1,1 +1,1 @@
-BME280_lib#0a0ad1327b0f
+https://os.mbed.com/teams/PQ_Hybrid_Electrical_Equipment_Team/code/BME280_lib/#0a0ad1327b0f
diff -r 3a2d0474f1ca -r 2ce2c7eebb92 CCS811_lib.lib
--- a/CCS811_lib.lib	Tue Mar 12 14:12:31 2019 +0000
+++ b/CCS811_lib.lib	Sun Apr 21 10:37:15 2019 +0000
@@ -1,1 +1,1 @@
-CCS811_lib#b0dd8ce53a43
+https://os.mbed.com/teams/PQ_Hybrid_Electrical_Equipment_Team/code/CCS811_lib/#b0dd8ce53a43
diff -r 3a2d0474f1ca -r 2ce2c7eebb92 INA226_lib.lib
--- a/INA226_lib.lib	Tue Mar 12 14:12:31 2019 +0000
+++ b/INA226_lib.lib	Sun Apr 21 10:37:15 2019 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/PQ_Hybrid_Electrical_Equipment_Team/code/INA226_lib/#741eb5bcfa1b
+https://developer.mbed.org/teams/PQ_Hybrid_Electrical_Equipment_Team/code/INA226_lib/#8f467f3e5f01
diff -r 3a2d0474f1ca -r 2ce2c7eebb92 main.cpp
--- a/main.cpp	Tue Mar 12 14:12:31 2019 +0000
+++ b/main.cpp	Sun Apr 21 10:37:15 2019 +0000
@@ -18,14 +18,14 @@
 設定値
 投下前に必ず確認!!
 *******************************************************************************/
-const float START_CONTROLL_TIME = 10.0f;
+const float START_CONTROLL_TIME = 1.0f;
 const float START_CONTROLL_ALT = -5.0f;
 
 const float RECOVERY_TIME = 120.0f;
 const float RECOVERY_SPEED = -2.0f;
 
-bool wait_GPS = false;
-bool ok_PC = true;
+bool wait_GPS = true;
+bool ok_PC = false;
 
 /*******************************************************************************
 コンストラクタ
@@ -35,9 +35,9 @@
 RawSerial serial_es920(p9, p10);
 ES920LR es920(serial_es920, pc, 115200);
 
-Serial GPS_serial(p13, p14, 38400);
+Serial GPS_serial(p13, p14, 9600);
 GPS_interrupt GPS(&GPS_serial);
-float GPS_freq = 4;
+float GPS_freq = 1;
 
 SDFileSystem sd(p5, p6, p7, p8, "sd");
 const char file_name[64] = "/sd/Space_SWAN_LOG.txt";
@@ -54,8 +54,8 @@
 
 Nichrome_lib Valve1(p23);
 Nichrome_lib Valve2(p24);
-Nichrome_lib Valve3(p24);
-Nichrome_lib Valve4(p25);
+Nichrome_lib Valve3(p25);
+Nichrome_lib Valve4(p26);
 Nichrome_lib Buzzer(p22);
 
 DigitalIn FlightPin(p15);
@@ -321,10 +321,12 @@
             startControllAttitude();
             start_controll_once = true;
         }
+        /*
         if(speed_ave > RECOVERY_SPEED && alt < 5.0f){
             timeout_recovery.detach();
             changePhase_RECOVERY();
         }
+        */
         break;
         
         case CANSAT_RECOVERY:
@@ -363,7 +365,25 @@
 *******************************************************************************/
 void controllAttitude(){
     if(controll_yn){
-        
+        if(euler[1] > 10){
+            Valve1.fire_on();
+            Valve3.fire_off();
+        }
+        else if(euler[1] < -10){
+            Valve1.fire_off();
+            Valve3.fire_on();
+        }
+        else{
+            Valve1.fire_off();
+            Valve3.fire_off();
+        }
+    }
+    
+    else{
+        Valve1.fire_off();
+        Valve2.fire_off();
+        Valve3.fire_off();
+        Valve4.fire_off();
     }
 }