Update button.py

This commit is contained in:
dylangoepel
2020-01-14 16:37:26 +01:00
committed by GitHub
parent 0948b52e68
commit ccd677b813

View File

@@ -162,14 +162,14 @@ gpio.setup(4, gpio.IN, pull_up_down=gpio.PUD_UP)
strip = NeoPixel(D18, 36, brightness=0.5, strip = NeoPixel(D18, 36, brightness=0.5,
pixel_order=GRB, auto_write=False) pixel_order=GRB, auto_write=False)
# Create subhandles for each button handles # Create subhandles for each button
leds = { leds = {
"cellar": ButtonStrip(strip, list(range(1, 12))), "cellar": ButtonStrip(strip, list(range(1, 12))),
"center": ButtonStrip(strip, list(range(12, 24))), "center": ButtonStrip(strip, list(range(12, 24))),
"aerie": ButtonStrip(strip, list(range(24, 36))), "aerie": ButtonStrip(strip, list(range(24, 36))),
} }
# Create button press sensor # Create button press sensor for input pins
buttons = { buttons = {
22: "cellar", 22: "cellar",
23: "aerie", 23: "aerie",
@@ -222,6 +222,6 @@ while True:
action = str(press) action = str(press)
if action == "center": if action == "center":
target=doors[selection].open() doors[selection].open()
elif action != selection: elif action != selection:
doors[selection].close() doors[selection].close()