Add initial reset func

This commit is contained in:
Garrett Mills 2025-07-29 22:19:44 -05:00
parent 1cf8f804e3
commit f17b850f6b

38
src/main.py Normal file
View File

@ -0,0 +1,38 @@
import RPi.GPIO as io
import time
io.setmode(io.BCM)
pins = {
"red": {
"pin": 27,
"off": io.HIGH,
},
"yellow": {
"pin": 22,
"off": io.HIGH,
},
"green": {
"pin": 24,
"off": io.HIGH,
},
"blue": {
"pin": 23,
"off": io.HIGH,
},
}
def off(pin):
return pin["off"]
def on(pin):
return io.LOW if pin["off"] == io.HIGH else io.LOW
def reset():
for name, pin in pins.items():
io.setmode(pin["pin"], io.OUT)
io.output(pin["pin"], off(pin))
reset()