Files
python-gpiozero/docs/examples/led_bargraph_1.py
Dave Jones 32803a7988 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)
2016-08-29 20:41:11 +01:00

16 lines
343 B
Python

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)