Update main.c don't show voltage and current in sstv if not sensor

beta-v1.3.1.1-sim
Alan Johnston 2 years ago committed by GitHub
parent 5252970097
commit fc81909d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -919,9 +919,13 @@ int main(int argc, char * argv[]) {
//#endif //#endif
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");
fprintf(fp, "BAT %4.2fV %5.1fmA\n", batteryVoltage, batteryCurrent); if (batteryVoltage != 4.5)
fprintf(fp, "BAT %4.2fV %5.1fmA\n", batteryVoltage, batteryCurrent);
else
fprintf(fp, "\n"); // don't show voltage and current if it isn't a sensor value
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.