Files
python-gpiozero/docs/examples/led_remote_4.py
2017-07-14 14:01:29 +01:00

16 lines
318 B
Python

from gpiozero import LED
from gpiozero.pins.rpigpio import RPiGPIOFactory
from time import sleep
local_factory = RPiGPIOFactory()
led_1 = LED(17, pin_factory=local_factory) # local pin
led_2 = LED(17) # remote pin
while True:
led_1.on()
led_2.off()
sleep(1)
led_1.off()
led_2.on()
sleep(1)