Update main.c show sim voltage and current in sstv

pi-sensors
Alan Johnston 3 months ago committed by GitHub
parent a3537e167b
commit 26c2d34d91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1003,8 +1003,7 @@ int main(int argc, char * argv[]) {
FILE * fp = fopen("/home/pi/CubeSatSim/telem_string.txt", "w"); FILE * fp = fopen("/home/pi/CubeSatSim/telem_string.txt", "w");
if (fp != NULL) { if (fp != NULL) {
// printf("Writing telem_string.txt\n"); // printf("Writing telem_string.txt\n");
// if (batteryVoltage != 4.5) { if (batteryVoltage != 4.5) {
if (1) {
/* /*
if (c2cStatus == DISABLED) if (c2cStatus == DISABLED)
fprintf(fp, "BAT %4.2fV %4.0fmA\n", batteryVoltage, batteryCurrent); fprintf(fp, "BAT %4.2fV %4.0fmA\n", batteryVoltage, batteryCurrent);
@ -1019,9 +1018,17 @@ int main(int argc, char * argv[]) {
else else
fprintf(fp,"\n"); fprintf(fp,"\n");
} }
else else {
fprintf(fp, "\n"); // don't show voltage and current if it isn't a sensor value // fprintf(fp, "\n"); // don't show voltage and current if it isn't a sensor value
fprintf(fp, "BAT %.2fV %.0fmA", voltage[map[BAT]], current[map[BAT]]; // display simulated voltage and current
if (c2cStatus != DISABLED)
fprintf(fp," C");
if (sim_mode || (failureMode != FAIL_NONE))
fprintf(fp," S\n");
else
fprintf(fp,"\n");
}
fclose(fp); fclose(fp);
} else } else
printf("Error writing to telem_string.txt\n"); printf("Error writing to telem_string.txt\n");

Loading…
Cancel
Save

Powered by TurnKey Linux.