![](/media/cache/group/icon1_qbDJ87a.png.50x50_q85.png)
izu2021mission
Dependencies: mbed ADS1015 PQ_LPS22HB SPS30 SDFileSystem
main.cpp@0:08e4b6ebbc85, 2021-03-04 (annotated)
- Committer:
- kazuncho
- Date:
- Thu Mar 04 07:38:29 2021 +0000
- Revision:
- 0:08e4b6ebbc85
mission
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kazuncho | 0:08e4b6ebbc85 | 1 | #include "mbed.h" |
kazuncho | 0:08e4b6ebbc85 | 2 | //#include <stdio.h> |
kazuncho | 0:08e4b6ebbc85 | 3 | #include <cmath> |
kazuncho | 0:08e4b6ebbc85 | 4 | |
kazuncho | 0:08e4b6ebbc85 | 5 | #include "SDFileSystem.h" |
kazuncho | 0:08e4b6ebbc85 | 6 | #include "Adafruit_ADS1015.h" |
kazuncho | 0:08e4b6ebbc85 | 7 | #include "PQ_LPS22HB.h" |
kazuncho | 0:08e4b6ebbc85 | 8 | #include "sps30.h" |
kazuncho | 0:08e4b6ebbc85 | 9 | |
kazuncho | 0:08e4b6ebbc85 | 10 | #define ADS1115_ADDR 0b1001000 |
kazuncho | 0:08e4b6ebbc85 | 11 | #define LOG_RATE 1 |
kazuncho | 0:08e4b6ebbc85 | 12 | |
kazuncho | 0:08e4b6ebbc85 | 13 | FILE *fp; |
kazuncho | 0:08e4b6ebbc85 | 14 | |
kazuncho | 0:08e4b6ebbc85 | 15 | Serial pc(USBTX,USBRX,115200); |
kazuncho | 0:08e4b6ebbc85 | 16 | I2C i2c(D4,D5); |
kazuncho | 0:08e4b6ebbc85 | 17 | SDFileSystem sd(D11, D12, D13, A3, "sd"); |
kazuncho | 0:08e4b6ebbc85 | 18 | |
kazuncho | 0:08e4b6ebbc85 | 19 | DigitalIn fligt_sig(D3); |
kazuncho | 0:08e4b6ebbc85 | 20 | DigitalIn sep_sig(D6); |
kazuncho | 0:08e4b6ebbc85 | 21 | DigitalOut relay(D0); |
kazuncho | 0:08e4b6ebbc85 | 22 | |
kazuncho | 0:08e4b6ebbc85 | 23 | Adafruit_ADS1115 ads1115(&i2c, ADS1115_ADDR); |
kazuncho | 0:08e4b6ebbc85 | 24 | LPS22HB lps33hw(i2c, LPS22HB::SA0_HIGH); |
kazuncho | 0:08e4b6ebbc85 | 25 | LPS22HB lps22hb(i2c, LPS22HB::SA0_LOW); |
kazuncho | 0:08e4b6ebbc85 | 26 | Sps30 sps(D4, D5, 100000); |
kazuncho | 0:08e4b6ebbc85 | 27 | |
kazuncho | 0:08e4b6ebbc85 | 28 | Timer mission_timer; |
kazuncho | 0:08e4b6ebbc85 | 29 | Timer flight_timer; |
kazuncho | 0:08e4b6ebbc85 | 30 | Timer sd_timer; |
kazuncho | 0:08e4b6ebbc85 | 31 | Ticker log_ticker; |
kazuncho | 0:08e4b6ebbc85 | 32 | |
kazuncho | 0:08e4b6ebbc85 | 33 | char file_name[64]; |
kazuncho | 0:08e4b6ebbc85 | 34 | char f_outside_lps; |
kazuncho | 0:08e4b6ebbc85 | 35 | char f_inside_lps; |
kazuncho | 0:08e4b6ebbc85 | 36 | |
kazuncho | 0:08e4b6ebbc85 | 37 | enum { |
kazuncho | 0:08e4b6ebbc85 | 38 | READY, |
kazuncho | 0:08e4b6ebbc85 | 39 | RISE, |
kazuncho | 0:08e4b6ebbc85 | 40 | FALL, |
kazuncho | 0:08e4b6ebbc85 | 41 | RECOVERY, |
kazuncho | 0:08e4b6ebbc85 | 42 | } phase; |
kazuncho | 0:08e4b6ebbc85 | 43 | |
kazuncho | 0:08e4b6ebbc85 | 44 | bool cut_off; |
kazuncho | 0:08e4b6ebbc85 | 45 | bool recovery; |
kazuncho | 0:08e4b6ebbc85 | 46 | |
kazuncho | 0:08e4b6ebbc85 | 47 | int mission_time; |
kazuncho | 0:08e4b6ebbc85 | 48 | int flight_time; |
kazuncho | 0:08e4b6ebbc85 | 49 | |
kazuncho | 0:08e4b6ebbc85 | 50 | float pitot_speed; |
kazuncho | 0:08e4b6ebbc85 | 51 | float density = 1.3; |
kazuncho | 0:08e4b6ebbc85 | 52 | float ground_press; |
kazuncho | 0:08e4b6ebbc85 | 53 | float outside_press; |
kazuncho | 0:08e4b6ebbc85 | 54 | float outside_temp; |
kazuncho | 0:08e4b6ebbc85 | 55 | float inside_press; |
kazuncho | 0:08e4b6ebbc85 | 56 | float inside_temp; |
kazuncho | 0:08e4b6ebbc85 | 57 | |
kazuncho | 0:08e4b6ebbc85 | 58 | void init(); |
kazuncho | 0:08e4b6ebbc85 | 59 | void pitot_tube(); |
kazuncho | 0:08e4b6ebbc85 | 60 | void lps33hw_mission(); |
kazuncho | 0:08e4b6ebbc85 | 61 | void lps22hb_mission(); |
kazuncho | 0:08e4b6ebbc85 | 62 | void record(); |
kazuncho | 0:08e4b6ebbc85 | 63 | void read(); |
kazuncho | 0:08e4b6ebbc85 | 64 | |
kazuncho | 0:08e4b6ebbc85 | 65 | int main() |
kazuncho | 0:08e4b6ebbc85 | 66 | { |
kazuncho | 0:08e4b6ebbc85 | 67 | init(); |
kazuncho | 0:08e4b6ebbc85 | 68 | mission_timer.start(); |
kazuncho | 0:08e4b6ebbc85 | 69 | while(1) { |
kazuncho | 0:08e4b6ebbc85 | 70 | //pitot_tube(); |
kazuncho | 0:08e4b6ebbc85 | 71 | lps33hw_mission(); |
kazuncho | 0:08e4b6ebbc85 | 72 | lps22hb_mission(); |
kazuncho | 0:08e4b6ebbc85 | 73 | //read(); |
kazuncho | 0:08e4b6ebbc85 | 74 | switch(phase) { |
kazuncho | 0:08e4b6ebbc85 | 75 | case READY: //0 |
kazuncho | 0:08e4b6ebbc85 | 76 | if(fligt_sig) { |
kazuncho | 0:08e4b6ebbc85 | 77 | phase = RISE; |
kazuncho | 0:08e4b6ebbc85 | 78 | flight_timer.start(); |
kazuncho | 0:08e4b6ebbc85 | 79 | } |
kazuncho | 0:08e4b6ebbc85 | 80 | break; |
kazuncho | 0:08e4b6ebbc85 | 81 | case RISE: //1 |
kazuncho | 0:08e4b6ebbc85 | 82 | if(sep_sig) { |
kazuncho | 0:08e4b6ebbc85 | 83 | phase = FALL; |
kazuncho | 0:08e4b6ebbc85 | 84 | } |
kazuncho | 0:08e4b6ebbc85 | 85 | break; |
kazuncho | 0:08e4b6ebbc85 | 86 | case FALL: //2 |
kazuncho | 0:08e4b6ebbc85 | 87 | if(outside_press > ground_press) { |
kazuncho | 0:08e4b6ebbc85 | 88 | phase = RECOVERY; |
kazuncho | 0:08e4b6ebbc85 | 89 | fclose(fp); |
kazuncho | 0:08e4b6ebbc85 | 90 | flight_timer.stop(); |
kazuncho | 0:08e4b6ebbc85 | 91 | } |
kazuncho | 0:08e4b6ebbc85 | 92 | break; |
kazuncho | 0:08e4b6ebbc85 | 93 | case RECOVERY: //3 |
kazuncho | 0:08e4b6ebbc85 | 94 | if(!recovery){ |
kazuncho | 0:08e4b6ebbc85 | 95 | relay = 0; //センサーへの電源供給停止 |
kazuncho | 0:08e4b6ebbc85 | 96 | cut_off = true; |
kazuncho | 0:08e4b6ebbc85 | 97 | recovery = true; |
kazuncho | 0:08e4b6ebbc85 | 98 | } |
kazuncho | 0:08e4b6ebbc85 | 99 | break; |
kazuncho | 0:08e4b6ebbc85 | 100 | } |
kazuncho | 0:08e4b6ebbc85 | 101 | wait(0.5); |
kazuncho | 0:08e4b6ebbc85 | 102 | } |
kazuncho | 0:08e4b6ebbc85 | 103 | } |
kazuncho | 0:08e4b6ebbc85 | 104 | |
kazuncho | 0:08e4b6ebbc85 | 105 | void init() |
kazuncho | 0:08e4b6ebbc85 | 106 | { |
kazuncho | 0:08e4b6ebbc85 | 107 | pc.printf("---PQ_Hybrid_Mission---\r\n"); |
kazuncho | 0:08e4b6ebbc85 | 108 | relay = 1; //センサーへ電源供給開始 |
kazuncho | 0:08e4b6ebbc85 | 109 | wait(1); |
kazuncho | 0:08e4b6ebbc85 | 110 | |
kazuncho | 0:08e4b6ebbc85 | 111 | lps33hw.begin(); |
kazuncho | 0:08e4b6ebbc85 | 112 | lps22hb.begin(); |
kazuncho | 0:08e4b6ebbc85 | 113 | ads1115.setGain(GAIN_TWOTHIRDS); |
kazuncho | 0:08e4b6ebbc85 | 114 | sps.StartFanClean(); |
kazuncho | 0:08e4b6ebbc85 | 115 | |
kazuncho | 0:08e4b6ebbc85 | 116 | sd.mount(); |
kazuncho | 0:08e4b6ebbc85 | 117 | mkdir("/sd", 0777); |
kazuncho | 0:08e4b6ebbc85 | 118 | char file_name_format[] = "/sd/IZU2021_MISSION_%d.dat"; |
kazuncho | 0:08e4b6ebbc85 | 119 | int file_number = 1; |
kazuncho | 0:08e4b6ebbc85 | 120 | while(1) { |
kazuncho | 0:08e4b6ebbc85 | 121 | sprintf(file_name, file_name_format, file_number); |
kazuncho | 0:08e4b6ebbc85 | 122 | fp = fopen(file_name, "r"); |
kazuncho | 0:08e4b6ebbc85 | 123 | if(fp != NULL) { |
kazuncho | 0:08e4b6ebbc85 | 124 | fclose(fp); |
kazuncho | 0:08e4b6ebbc85 | 125 | file_number++; |
kazuncho | 0:08e4b6ebbc85 | 126 | } else { |
kazuncho | 0:08e4b6ebbc85 | 127 | sprintf(file_name, "/sd/IZU2021_MISSION_%d.dat", file_number); |
kazuncho | 0:08e4b6ebbc85 | 128 | break; |
kazuncho | 0:08e4b6ebbc85 | 129 | } |
kazuncho | 0:08e4b6ebbc85 | 130 | } |
kazuncho | 0:08e4b6ebbc85 | 131 | fp = fopen(file_name, "w"); |
kazuncho | 0:08e4b6ebbc85 | 132 | sd_timer.start(); |
kazuncho | 0:08e4b6ebbc85 | 133 | if(fp) { |
kazuncho | 0:08e4b6ebbc85 | 134 | fprintf(fp, "mission_time[s]\t"); |
kazuncho | 0:08e4b6ebbc85 | 135 | fprintf(fp, "flight_time[s]\t"); |
kazuncho | 0:08e4b6ebbc85 | 136 | fprintf(fp, "phase\t"); |
kazuncho | 0:08e4b6ebbc85 | 137 | fprintf(fp, "cut_off\t"); |
kazuncho | 0:08e4b6ebbc85 | 138 | fprintf(fp, "pitot_speed[m/s]\t"); |
kazuncho | 0:08e4b6ebbc85 | 139 | fprintf(fp, "pitot_speed[km/h]\t"); |
kazuncho | 0:08e4b6ebbc85 | 140 | fprintf(fp, "mass_1p0\t"); |
kazuncho | 0:08e4b6ebbc85 | 141 | fprintf(fp, "mass_2p5\t"); |
kazuncho | 0:08e4b6ebbc85 | 142 | fprintf(fp, "mass_4p0\t"); |
kazuncho | 0:08e4b6ebbc85 | 143 | fprintf(fp, "mass_10p0\t"); |
kazuncho | 0:08e4b6ebbc85 | 144 | fprintf(fp, "num_0p5\t"); |
kazuncho | 0:08e4b6ebbc85 | 145 | fprintf(fp, "num_1p0\t"); |
kazuncho | 0:08e4b6ebbc85 | 146 | fprintf(fp, "num_2p5\t"); |
kazuncho | 0:08e4b6ebbc85 | 147 | fprintf(fp, "num_4p0\t"); |
kazuncho | 0:08e4b6ebbc85 | 148 | fprintf(fp, "num_10p0\t"); |
kazuncho | 0:08e4b6ebbc85 | 149 | fprintf(fp, "typ_pm_size\t"); |
kazuncho | 0:08e4b6ebbc85 | 150 | fprintf(fp, "outside_press[Pa]\t"); |
kazuncho | 0:08e4b6ebbc85 | 151 | fprintf(fp, "outside_temp[degC]\t"); |
kazuncho | 0:08e4b6ebbc85 | 152 | fprintf(fp, "inside_press[Pa]\t"); |
kazuncho | 0:08e4b6ebbc85 | 153 | fprintf(fp, "inside_temp[degC]\t"); |
kazuncho | 0:08e4b6ebbc85 | 154 | fprintf(fp, "\r\n"); |
kazuncho | 0:08e4b6ebbc85 | 155 | } |
kazuncho | 0:08e4b6ebbc85 | 156 | |
kazuncho | 0:08e4b6ebbc85 | 157 | /***************************************** |
kazuncho | 0:08e4b6ebbc85 | 158 | /地上の気圧を測定。リレーの解除に使う |
kazuncho | 0:08e4b6ebbc85 | 159 | ******************************************/ |
kazuncho | 0:08e4b6ebbc85 | 160 | float temp_press = 0; |
kazuncho | 0:08e4b6ebbc85 | 161 | float sum = 0; |
kazuncho | 0:08e4b6ebbc85 | 162 | int i = 0; |
kazuncho | 0:08e4b6ebbc85 | 163 | while(i < 10) { |
kazuncho | 0:08e4b6ebbc85 | 164 | lps33hw.read_press(&temp_press); |
kazuncho | 0:08e4b6ebbc85 | 165 | sum += temp_press; |
kazuncho | 0:08e4b6ebbc85 | 166 | i++; |
kazuncho | 0:08e4b6ebbc85 | 167 | wait(0.5); |
kazuncho | 0:08e4b6ebbc85 | 168 | } |
kazuncho | 0:08e4b6ebbc85 | 169 | ground_press = sum/10.0f; |
kazuncho | 0:08e4b6ebbc85 | 170 | |
kazuncho | 0:08e4b6ebbc85 | 171 | log_ticker.attach(record, 1.0f/LOG_RATE); |
kazuncho | 0:08e4b6ebbc85 | 172 | //キャッシュオーバーに注意 |
kazuncho | 0:08e4b6ebbc85 | 173 | //read_ticker.attach(read, 0.5); |
kazuncho | 0:08e4b6ebbc85 | 174 | } |
kazuncho | 0:08e4b6ebbc85 | 175 | |
kazuncho | 0:08e4b6ebbc85 | 176 | /********************************************* |
kazuncho | 0:08e4b6ebbc85 | 177 | / MPXV5004DPの場合:(Differencial) = ((Vout / Vs) - 0.2) / 0.2 |
kazuncho | 0:08e4b6ebbc85 | 178 | / MPX5010DPの場合:(Differencial) = ((Vout / Vs) - 0.04) / 0.09 |
kazuncho | 0:08e4b6ebbc85 | 179 | / speed = root(2 * P / ρ) |
kazuncho | 0:08e4b6ebbc85 | 180 | / pitot_paが負のときnanが返される |
kazuncho | 0:08e4b6ebbc85 | 181 | **********************************************/ |
kazuncho | 0:08e4b6ebbc85 | 182 | void pitot_tube(){ |
kazuncho | 0:08e4b6ebbc85 | 183 | float sum = 0; |
kazuncho | 0:08e4b6ebbc85 | 184 | float voltage = 0; |
kazuncho | 0:08e4b6ebbc85 | 185 | float pitot_pa = 0; |
kazuncho | 0:08e4b6ebbc85 | 186 | float pitot_volt = 0; |
kazuncho | 0:08e4b6ebbc85 | 187 | for(int i = 0; i < 10; i++){ |
kazuncho | 0:08e4b6ebbc85 | 188 | int16_t val = ads1115.readADC_SingleEnded(0); |
kazuncho | 0:08e4b6ebbc85 | 189 | voltage = val / 32768.0 * 6.144; |
kazuncho | 0:08e4b6ebbc85 | 190 | sum += voltage; |
kazuncho | 0:08e4b6ebbc85 | 191 | } |
kazuncho | 0:08e4b6ebbc85 | 192 | float v_ave = sum / 10.0f; |
kazuncho | 0:08e4b6ebbc85 | 193 | pitot_volt = voltage - v_ave + 0.2f; |
kazuncho | 0:08e4b6ebbc85 | 194 | pitot_pa = (pitot_volt / 5.0f - 0.04f) / 0.09f; |
kazuncho | 0:08e4b6ebbc85 | 195 | pitot_speed = sqrt(2 * pitot_pa * 1000 / density); |
kazuncho | 0:08e4b6ebbc85 | 196 | } |
kazuncho | 0:08e4b6ebbc85 | 197 | |
kazuncho | 0:08e4b6ebbc85 | 198 | /********************************************* |
kazuncho | 0:08e4b6ebbc85 | 199 | / 水密外配置。リレーの条件に使用する。 |
kazuncho | 0:08e4b6ebbc85 | 200 | **********************************************/ |
kazuncho | 0:08e4b6ebbc85 | 201 | void lps33hw_mission() |
kazuncho | 0:08e4b6ebbc85 | 202 | { |
kazuncho | 0:08e4b6ebbc85 | 203 | f_outside_lps = lps33hw.test(); |
kazuncho | 0:08e4b6ebbc85 | 204 | if(f_outside_lps) { |
kazuncho | 0:08e4b6ebbc85 | 205 | outside_press = 0; |
kazuncho | 0:08e4b6ebbc85 | 206 | outside_temp = 0; |
kazuncho | 0:08e4b6ebbc85 | 207 | lps33hw.read_press(&outside_press); |
kazuncho | 0:08e4b6ebbc85 | 208 | lps33hw.read_temp(&outside_temp); |
kazuncho | 0:08e4b6ebbc85 | 209 | } |
kazuncho | 0:08e4b6ebbc85 | 210 | } |
kazuncho | 0:08e4b6ebbc85 | 211 | |
kazuncho | 0:08e4b6ebbc85 | 212 | /********************************************* |
kazuncho | 0:08e4b6ebbc85 | 213 | / 水密内配置。水密になっているかの確認用。 |
kazuncho | 0:08e4b6ebbc85 | 214 | **********************************************/ |
kazuncho | 0:08e4b6ebbc85 | 215 | void lps22hb_mission() |
kazuncho | 0:08e4b6ebbc85 | 216 | { |
kazuncho | 0:08e4b6ebbc85 | 217 | f_inside_lps = lps22hb.test(); |
kazuncho | 0:08e4b6ebbc85 | 218 | if(f_inside_lps) { |
kazuncho | 0:08e4b6ebbc85 | 219 | inside_press = 0; |
kazuncho | 0:08e4b6ebbc85 | 220 | inside_temp = 0; |
kazuncho | 0:08e4b6ebbc85 | 221 | lps22hb.read_press(&inside_press); |
kazuncho | 0:08e4b6ebbc85 | 222 | lps22hb.read_temp(&inside_temp); |
kazuncho | 0:08e4b6ebbc85 | 223 | } |
kazuncho | 0:08e4b6ebbc85 | 224 | } |
kazuncho | 0:08e4b6ebbc85 | 225 | |
kazuncho | 0:08e4b6ebbc85 | 226 | void record() |
kazuncho | 0:08e4b6ebbc85 | 227 | { |
kazuncho | 0:08e4b6ebbc85 | 228 | mission_time = mission_timer.read(); |
kazuncho | 0:08e4b6ebbc85 | 229 | flight_time = flight_timer.read(); |
kazuncho | 0:08e4b6ebbc85 | 230 | fprintf(fp, "%4d\t", mission_time); |
kazuncho | 0:08e4b6ebbc85 | 231 | fprintf(fp, "%4d\t", flight_time); |
kazuncho | 0:08e4b6ebbc85 | 232 | fprintf(fp, "%1d\t", phase); |
kazuncho | 0:08e4b6ebbc85 | 233 | fprintf(fp, "%1d\t", cut_off); |
kazuncho | 0:08e4b6ebbc85 | 234 | fprintf(fp, "%f\t", pitot_speed); |
kazuncho | 0:08e4b6ebbc85 | 235 | fprintf(fp, "%f\t", pitot_speed * 3600 / 1000.0f); |
kazuncho | 0:08e4b6ebbc85 | 236 | fprintf(fp, "%f\t", sps.mass_1p0_f); |
kazuncho | 0:08e4b6ebbc85 | 237 | fprintf(fp, "%f\t", sps.mass_2p5_f); |
kazuncho | 0:08e4b6ebbc85 | 238 | fprintf(fp, "%f\t", sps.mass_4p0_f); |
kazuncho | 0:08e4b6ebbc85 | 239 | fprintf(fp, "%f\t", sps.mass_10p0_f); |
kazuncho | 0:08e4b6ebbc85 | 240 | fprintf(fp, "%f\t", sps.num_0p5_f); |
kazuncho | 0:08e4b6ebbc85 | 241 | fprintf(fp, "%f\t", sps.num_1p0_f); |
kazuncho | 0:08e4b6ebbc85 | 242 | fprintf(fp, "%f\t", sps.num_2p5_f); |
kazuncho | 0:08e4b6ebbc85 | 243 | fprintf(fp, "%f\t", sps.num_4p0_f); |
kazuncho | 0:08e4b6ebbc85 | 244 | fprintf(fp, "%f\t", sps.num_10p0_f); |
kazuncho | 0:08e4b6ebbc85 | 245 | fprintf(fp, "%f\t", sps.typ_pm_size_f); |
kazuncho | 0:08e4b6ebbc85 | 246 | fprintf(fp, "%f\t", outside_press); |
kazuncho | 0:08e4b6ebbc85 | 247 | fprintf(fp, "%f\t", outside_temp); |
kazuncho | 0:08e4b6ebbc85 | 248 | fprintf(fp, "%f\t", inside_press); |
kazuncho | 0:08e4b6ebbc85 | 249 | fprintf(fp, "%f\t", inside_temp); |
kazuncho | 0:08e4b6ebbc85 | 250 | fprintf(fp, "\r\n"); |
kazuncho | 0:08e4b6ebbc85 | 251 | |
kazuncho | 0:08e4b6ebbc85 | 252 | if(sd_timer.read_ms() >= 60*1000) { //1分ごとにリセット、開き直す。 |
kazuncho | 0:08e4b6ebbc85 | 253 | sd_timer.reset(); |
kazuncho | 0:08e4b6ebbc85 | 254 | sd_timer.start(); |
kazuncho | 0:08e4b6ebbc85 | 255 | if(fp) { |
kazuncho | 0:08e4b6ebbc85 | 256 | fclose(fp); |
kazuncho | 0:08e4b6ebbc85 | 257 | fp = fopen(file_name, "a"); //a:追加書き込みモード |
kazuncho | 0:08e4b6ebbc85 | 258 | } |
kazuncho | 0:08e4b6ebbc85 | 259 | } |
kazuncho | 0:08e4b6ebbc85 | 260 | } |
kazuncho | 0:08e4b6ebbc85 | 261 | |
kazuncho | 0:08e4b6ebbc85 | 262 | /* |
kazuncho | 0:08e4b6ebbc85 | 263 | void read() |
kazuncho | 0:08e4b6ebbc85 | 264 | { |
kazuncho | 0:08e4b6ebbc85 | 265 | pc.printf("mission_time:\t"); |
kazuncho | 0:08e4b6ebbc85 | 266 | pc.printf("flight_time:\t"); |
kazuncho | 0:08e4b6ebbc85 | 267 | pc.printf("phase:\t"); |
kazuncho | 0:08e4b6ebbc85 | 268 | pc.printf("f_sps:\t"); |
kazuncho | 0:08e4b6ebbc85 | 269 | pc.printf("SPEED[m/s]:\t"); |
kazuncho | 0:08e4b6ebbc85 | 270 | pc.printf("SPEED[km/h]:\t"); |
kazuncho | 0:08e4b6ebbc85 | 271 | pc.printf("MASS_1P0\t"); |
kazuncho | 0:08e4b6ebbc85 | 272 | pc.printf("MASS_2P5\t"); |
kazuncho | 0:08e4b6ebbc85 | 273 | pc.printf("MASS_4P0\t"); |
kazuncho | 0:08e4b6ebbc85 | 274 | pc.printf("MASS_10P0\t"); |
kazuncho | 0:08e4b6ebbc85 | 275 | pc.printf("NUM_0P5\t"); |
kazuncho | 0:08e4b6ebbc85 | 276 | pc.printf("NUM_1P0\t"); |
kazuncho | 0:08e4b6ebbc85 | 277 | pc.printf("NUM_2P5\t"); |
kazuncho | 0:08e4b6ebbc85 | 278 | pc.printf("NUM_4P0\t"); |
kazuncho | 0:08e4b6ebbc85 | 279 | pc.printf("NUM_10P0\t"); |
kazuncho | 0:08e4b6ebbc85 | 280 | pc.printf("PM_SIZE\t"); |
kazuncho | 0:08e4b6ebbc85 | 281 | pc.printf("OUT_PRESS\t"); |
kazuncho | 0:08e4b6ebbc85 | 282 | pc.printf("OUT_TEMP\t"); |
kazuncho | 0:08e4b6ebbc85 | 283 | pc.printf("IN_PRESS\t"); |
kazuncho | 0:08e4b6ebbc85 | 284 | pc.printf("IN_TEMP\t"); |
kazuncho | 0:08e4b6ebbc85 | 285 | pc.printf("\r\n"); |
kazuncho | 0:08e4b6ebbc85 | 286 | pc.printf("%4d\t", mission_time); |
kazuncho | 0:08e4b6ebbc85 | 287 | pc.printf("%d\t", (int)phase); |
kazuncho | 0:08e4b6ebbc85 | 288 | pc.printf("%c\t", (int)relay); |
kazuncho | 0:08e4b6ebbc85 | 289 | pc.printf("%f\t", pitot_speed); |
kazuncho | 0:08e4b6ebbc85 | 290 | pc.printf("%f\t", pitot_speed * 3600 / 1000.0f); |
kazuncho | 0:08e4b6ebbc85 | 291 | pc.printf("%f\t", sps.mass_1p0_f); |
kazuncho | 0:08e4b6ebbc85 | 292 | pc.printf("%f\t", sps.mass_2p5_f); |
kazuncho | 0:08e4b6ebbc85 | 293 | pc.printf("%f\t", sps.mass_4p0_f); |
kazuncho | 0:08e4b6ebbc85 | 294 | pc.printf("%f\t", sps.mass_10p0_f); |
kazuncho | 0:08e4b6ebbc85 | 295 | pc.printf("%f\t", sps.num_0p5_f); |
kazuncho | 0:08e4b6ebbc85 | 296 | pc.printf("%f\t", sps.num_1p0_f); |
kazuncho | 0:08e4b6ebbc85 | 297 | pc.printf("%f\t", sps.num_2p5_f); |
kazuncho | 0:08e4b6ebbc85 | 298 | pc.printf("%f\t", sps.num_4p0_f); |
kazuncho | 0:08e4b6ebbc85 | 299 | pc.printf("%f\t", sps.num_10p0_f); |
kazuncho | 0:08e4b6ebbc85 | 300 | pc.printf("%f\t", sps.typ_pm_size_f); |
kazuncho | 0:08e4b6ebbc85 | 301 | pc.printf("%.2f\t", ground_press); |
kazuncho | 0:08e4b6ebbc85 | 302 | pc.printf("%.2f\t", outside_press); |
kazuncho | 0:08e4b6ebbc85 | 303 | pc.printf("%.1f\t", outside_temp); |
kazuncho | 0:08e4b6ebbc85 | 304 | pc.printf("%.2f\t", inside_press); |
kazuncho | 0:08e4b6ebbc85 | 305 | pc.printf("%.1f\t", inside_temp); |
kazuncho | 0:08e4b6ebbc85 | 306 | pc.printf("\r\n"); |
kazuncho | 0:08e4b6ebbc85 | 307 | } |
kazuncho | 0:08e4b6ebbc85 | 308 | */ |