mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2026-01-30 21:27:17 +00:00
Docs updates: add installing, advanced recipes, remote gpio and remote recipes - wip
This commit is contained in:
17
docs/examples/led_remote_5.py
Normal file
17
docs/examples/led_remote_5.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from gpiozero import LED
|
||||
from gpiozero.pins.pigpio import PiGPIOPin
|
||||
from time import sleep
|
||||
|
||||
led_1 = LED(17) # local pin
|
||||
led_2 = LED(PiGPIOPin(17, host='192.168.1.3')) # remote pin on one pi
|
||||
led_3 = LED(PiGPIOPin(17, host='192.168.1.4')) # remote pin on another pi
|
||||
|
||||
while True:
|
||||
led_1.on()
|
||||
led_2.off()
|
||||
led_3.on()
|
||||
sleep(1)
|
||||
led_1.off()
|
||||
led_2.on()
|
||||
led_3.off()
|
||||
sleep(1)
|
||||
Reference in New Issue
Block a user