From e587b0ef019bcfd24b4b76e06234d2f2505f0a95 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 30 Jul 2023 11:31:18 -0400 Subject: [PATCH] add command_tx toggled by reading squelch on blink --- rpitx.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rpitx.py b/rpitx.py index 4af2f399..93669270 100644 --- a/rpitx.py +++ b/rpitx.py @@ -14,6 +14,9 @@ print("CubeSatSim v1.3b rpitx.py starting...") pd = 21 ptt = 20 txc = 7 +squelch = 6 + +command_tx = True GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) @@ -22,6 +25,8 @@ GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(7, GPIO.IN, pull_up_down=GPIO.PUD_UP) +GPIO.setup(squelch, GPIO.IN) + transmit = False if GPIO.input(12) == False: print("Version is v1 with UHF BPF") @@ -371,6 +376,9 @@ if __name__ == "__main__": while 1: output(txLed, txLedOff) sleep(0.5) + if GPIO.input(squelch) == False: + command_tx = ~command_tx + print(command_tx) output(txLed, txLedOn) sleep(4.0) else: @@ -380,6 +388,9 @@ if __name__ == "__main__": while 1: output(txLed, txLedOff) sleep(0.5) + if GPIO.input(squelch) == False: + command_tx = ~command_tx + print(command_tx) output(txLed, txLedOn) sleep(4.0) else: