Update simulated payload parameters and telemetry add sim payload values

master-fsk-cw
Alan Johnston 2 weeks ago committed by GitHub
parent 47943cf143
commit 83d4344375
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -429,6 +429,14 @@ int main(int argc, char * argv[]) {
eclipse_time = (long int)(millis() / 1000.0); eclipse_time = (long int)(millis() / 1000.0);
if (eclipse == 0.0) if (eclipse == 0.0)
eclipse_time -= period / 2; // if starting in eclipse, shorten interval eclipse_time -= period / 2; // if starting in eclipse, shorten interval
tempP = rnd_float(-25, -15); // simulated payload parameters
altSP = rnd_float(28000, 32000);
changeP = rnd_float(-10, 10);
presP = rnd_float(1014, 1016);
altGP = rnd_float(20,120);
humiP = rnd_float(40,60);
} }
// tx_freq_hz -= tx_channel * 50000; // tx_freq_hz -= tx_channel * 50000;
@ -848,26 +856,39 @@ int main(int argc, char * argv[]) {
newGpsTime = millis(); newGpsTime = millis();
} }
/*
tempP = rnd_float(-25, -15); // simulated payload parameters
= rnd_float(28000, 32000);
changeP = rnd_float(-10, 10);
presP = rnd_float(1014, 1016);
altGP = rnd_float(20,120);
humiP
*/
if (sim_mode && (failureMode != FAIL_PAYLOAD) && !payload) { if (sim_mode && (failureMode != FAIL_PAYLOAD) && !payload) {
printf("Generating simulated payload telemetry\n"); printf("Generating simulated payload telemetry\n");
if (atmosphere == 0) { if (atmosphere == 0) {
sensor[PRES] = 0; sensor[PRES] = 0;
strcpy(sensor_string[PRES], "0.0"); strcpy(sensor_string[PRES], "0.0");
sensor[ALT] = 400; sensor[ALT] = altSP;
strcpy(sensor_string[ALT], "30000"); strcpy(sensor_string[ALT], itoa(altSP));
print("Alt: %s\n", sensor_string[ALT]);
sensor[HUMI] = 0; sensor[HUMI] = 0;
strcpy(sensor_string[HUMI], "0.0"); strcpy(sensor_string[HUMI], "0.0");
sensor[TEMP] = 0; sensor[TEMP] = itoa(tempP + 80 * (1 - eclipse));
strcpy(sensor_string[TEMP], "0.0"); strcpy(sensor_string[TEMP], itoa(tempP + 80 * (1 - eclipse)));
print("Temp: %s\n", sensor_string[TEMP]);
} else { } else {
sensor[PRES] = 1015; sensor[PRES] = presP;
strcpy(sensor_string[PRES], "1015"); strcpy(sensor_string[PRES], atoi(presP));
sensor[ALT] = 75; print("Pres: %s\n", sensor_string[PRES]);
strcpy(sensor_string[ALT], "75"); sensor[ALT] = altGP;
sensor[HUMI] = 48; strcpy(sensor_string[ALT], atoi(altGP));
strcpy(sensor_string[HUMI], "48"); sensor[HUMI] = humiP;
sensor[TEMP] = 27; strcpy(sensor_string[HUMI], atoi(humiP));
strcpy(sensor_string[TEMP], "27.0"); sensor[TEMP] = itoa(tempP + 80 * (1 - eclipse));
strcpy(sensor_string[TEMP], itoa(tempP + 80 * (1 - eclipse)));
print("Temp: %s\n", sensor_string[TEMP]);
} }
char sensor_number[20]; char sensor_number[20];
sensor[ACCEL_X] = axis[X]; sensor[ACCEL_X] = axis[X];

Loading…
Cancel
Save

Powered by TurnKey Linux.