Files
python-gpiozero/docs/examples/led_bargraph_2.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
355 B
Python

from gpiozero import LEDBarGraph
from time import sleep
graph = LEDBarGraph(5, 6, 13, 19, 26, pwm=True)
graph.value = 1/10 # (0.5, 0, 0, 0, 0)
sleep(1)
graph.value = 3/10 # (1, 0.5, 0, 0, 0)
sleep(1)
graph.value = -3/10 # (0, 0, 0, 0.5, 1)
sleep(1)
graph.value = 9/10 # (1, 1, 1, 1, 0.5)
sleep(1)
graph.value = 95/100 # (1, 1, 1, 1, 0.75)
sleep(1)