import colorsys import time from abstract import * RED: tuple[int, int, int] = (255, 0, 0) 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: 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!!!")