Commit 16660280 authored by Adam Blank's avatar Adam Blank
Browse files

autocommit

No related merge requests found
Showing with 23 additions and 1 deletion
+23 -1
......@@ -8,6 +8,28 @@ GREEN: tuple[int, int, int] = (0, 255, 0)
YELLOW: tuple[int, int, int] = (255, 255, 0)
def change_color(color: tuple[int, int, int]) -> tuple[int, int, int]:
if color == RED:
color = GREEN
elif color == YELLOW:
color = RED
else:
color = YELLOW
return color
def run(apds: ProximitySensor, pixels: LEDController, touch: TouchSensor):
color: tuple[int, int, int] = RED
while True:
pixels.fill(YELLOW)
print("d")
prox = apds.proximity
if prox >= 10 or color == GREEN:
color = change_color(color)
else:
color = RED
pixels.fill(color)
time.sleep(1)
if touch.value:
print("hi!!!")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment