mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2026-02-02 14:45:47 +00:00
Convert recipe examples to includes
Makes it much easier to test things - no copying'n'pasting just run the examples straight from the dir (after wiring stuff up)
This commit is contained in:
15
docs/examples/led_bargraph_1.py
Normal file
15
docs/examples/led_bargraph_1.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from gpiozero import LEDBarGraph
|
||||
from time import sleep
|
||||
|
||||
graph = LEDBarGraph(5, 6, 13, 19, 26, 20)
|
||||
|
||||
graph.value = 1 # (1, 1, 1, 1, 1, 1)
|
||||
sleep(1)
|
||||
graph.value = 1/2 # (1, 1, 1, 0, 0, 0)
|
||||
sleep(1)
|
||||
graph.value = -1/2 # (0, 0, 0, 1, 1, 1)
|
||||
sleep(1)
|
||||
graph.value = 1/4 # (1, 0, 0, 0, 0, 0)
|
||||
sleep(1)
|
||||
graph.value = -1 # (1, 1, 1, 1, 1, 1)
|
||||
sleep(1)
|
||||
Reference in New Issue
Block a user