mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
Add source/values docs page, close #448
This commit is contained in:
12
docs/examples/custom_generator.py
Normal file
12
docs/examples/custom_generator.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user