Files
python-gpiozero/docs/examples/custom_generator.py
2016-10-09 21:19:27 +01:00

13 lines
178 B
Python

from gpiozero import LED
from random import randint
from signal import pause
def rand():
while True:
yield randint(0, 1)
led = LED(17)
led.source = rand()
pause()