Update aprs_in.py increment command_count

pull/323/head
Alan Johnston 2 years ago committed by GitHub
parent 37b6cdbd19
commit 45b18c5050
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -38,6 +38,22 @@ if __name__ == "__main__":
mode = 'm'
change_mode = True
if (debug_mode == False) and (change_mode == True):
try:
file = open("/home/pi/CubeSatSim/command_count.txt", "r")
string = file.read()
file.close()
command_count = int(string)
command_count += 1
filec = open("/home/pi/CubeSatSim/command_count.txt", "w")
command_count_string = str(command_count)
print(command_count_string)
string = filec.write(command_count_string)
filec.close()
except:
print("Can't write command_count file!")
print("Command_count: ")
print(command_count)
print("\n/home/pi/CubeSatSim/config -" + mode)
system("/home/pi/CubeSatSim/config -" + mode)
change_mode = False

Loading…
Cancel
Save

Powered by TurnKey Linux.