Correct remote GPIO recipes

This commit is contained in:
Dave Jones
2017-07-14 14:01:29 +01:00
parent eafae5c31a
commit b2e4237a57
13 changed files with 62 additions and 44 deletions

View File

@@ -1,10 +1,13 @@
from gpiozero import LED
from gpiozero.pins.pigpio import PiGPIOPin
from gpiozero.pins.pigpio import PiGPIOFactory
from time import sleep
factory3 = PiGPIOFactory(host='192.168.1.3')
factory4 = PiGPIOFactory(host='192.168.1.4')
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
led_2 = LED(17, pin_factory=factory3) # remote pin on one pi
led_3 = LED(17, pin_factory=factory4) # remote pin on another pi
while True:
led_1.on()