techoverload/led.py

19 lines
257 B
Python
Raw Permalink Normal View History

2022-07-16 11:13:36 +00:00
from gpiozero import LED, Button
from time import sleep
import random
count = 0
leds = [LED(19), LED(26), LED(13)]
button = Button(5)
def b():
print("pressed")
button.when_pressed = b
while True:
leds[random.randint(0,2)].toggle()
sleep(0.2)