From 0eb511c2ae1f6aa9dc3ddab177d2033299bd8882 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 30 Jul 2020 12:02:20 -0400 Subject: [PATCH] added tx LED detection and on/off for SSTV --- rpitx.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index ffd76f00..650cd273 100644 --- a/rpitx.py +++ b/rpitx.py @@ -15,7 +15,16 @@ if GPIO.input(12) == False: transmit = True if GPIO.input(27) == False: transmit = True - + txLed = 22 + txLedOn = False + txLedOff = True +else: + txLed = 27 + txLedOn = True + txLedOff = False + +GPIO.setup(txLed, GPIO.OUT) + print(transmit) file = open("/home/pi/CubeSatSim/sim.cfg") @@ -42,7 +51,9 @@ if __name__ == "__main__": print("SSTV") # os.system("(while true; do (sleep 10 && cat /home/pi/sstv/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3); done)") while True: + GPIO.output(txLed, txLedOff); time.sleep(10) + GPIO.output(txLed, txLedOn); os.system("cat /home/pi/sstv/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK")