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

autocommit

No related merge requests found
Showing with 1 addition and 20 deletions
+1 -20
......@@ -9,24 +9,5 @@ BLUE: tuple[int, int, int] = (0, 0, 255)
def run(apds: ProximitySensor, pixels: LEDController, touch: TouchSensor):
led_is_on: bool = False
hue = 0
while True:
if led_is_on:
r, g, b = colorsys.hsv_to_rgb(hue, 1, 1)
pixels.fill((int(r*255), int(g*255), int(b*255)))
hue += 0.01
if hue >= 1:
hue = 0
print(apds.proximity)
time.sleep(apds.proximity / 255)
else:
pixels.fill((0, 0, 0))
if touch.value:
led_is_on = not led_is_on
print("touch.")
time.sleep(1)
pixels.fill((BLUE))
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