Add debug print statements in transmit.py and fix setup to use pin

Added print statements to output and setup functions for debugging.
master-b-gpio
Alan Johnston 1 month ago committed by GitHub
parent 4bf3705186
commit 92730d5b7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -17,6 +17,7 @@ import subprocess
def output(pin, value): def output(pin, value):
command = "gpio -g write " + str(pin) + " " + str(value) command = "gpio -g write " + str(pin) + " " + str(value)
system(command) system(command)
print(command)
def input(pin): def input(pin):
# command = "gpio -g read " + str(pin) # command = "gpio -g read " + str(pin)
@ -36,8 +37,9 @@ def input(pin):
def setup(pin, config): def setup(pin, config):
if config == "in" or config == "out" or config == "up" or config == "down": if config == "in" or config == "out" or config == "up" or config == "down":
command = "gpio -g mode " + str(powerPin) + " " + config command = "gpio -g mode " + str(pin) + " " + config
system(command) system(command)
print(command)
else: else:
print(f"Unknown GPIO setup configuration: {config}") print(f"Unknown GPIO setup configuration: {config}")

Loading…
Cancel
Save

Powered by TurnKey Linux.