mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2026-02-01 22:26:14 +00:00
Add more ledboard examples
This commit is contained in:
15
docs/examples/led_board_7.py
Normal file
15
docs/examples/led_board_7.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from gpiozero import LEDBoard
|
||||
from time import sleep
|
||||
|
||||
leds = LEDBoard(red=LEDBoard(top=2, bottom=3), green=LEDBoard(top=4, bottom=5))
|
||||
|
||||
leds.red.on() ## both reds on
|
||||
sleep(1)
|
||||
leds.green.on() # both greens on
|
||||
sleep(1)
|
||||
leds.off() # all off
|
||||
sleep(1)
|
||||
leds.red.top.on() # top red on
|
||||
sleep(1)
|
||||
leds.green.bottom.on() # bottom green on
|
||||
sleep(1)
|
||||
Reference in New Issue
Block a user