mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
16 lines
335 B
Python
16 lines
335 B
Python
from gpiozero import LED
|
|
from gpiozero.pins.pigpio import PiGPIOFactory
|
|
from time import sleep
|
|
|
|
remote_factory = PiGPIOFactory(host='192.168.1.3')
|
|
led_1 = LED(17) # local pin
|
|
led_2 = LED(17, pin_factory=remote_factory) # remote pin
|
|
|
|
while True:
|
|
led_1.on()
|
|
led_2.off()
|
|
sleep(1)
|
|
led_1.off()
|
|
led_2.on()
|
|
sleep(1)
|