diff --git a/txLED.py b/txLED.py new file mode 100644 index 00000000..af9b6d51 --- /dev/null +++ b/txLED.py @@ -0,0 +1,25 @@ +import RPi.GPIO as GPIO +import subprocess +import time +import os +from time import sleep + +txPin = 27 +pttPin = 20 + +GPIO.setmode(GPIO.BCM) +GPIO.setwarnings(False) +GPIO.setup(txPin, GPIO.OUT) +GPIO.output(txPin, 0) +print("0") +GPIO.setup(pttPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) + +while (True): + sleep(0.1) + GPIO.wait_for_edge(pttPin, GPIO.FALLING) + GPIO.output(txPin, 1) + sleep(0.1) + print("1") + GPIO.wait_for_edge(pttPin, GPIO.RISING) + GPIO.output(txPin, 0) + print("0")