mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
15 lines
424 B
Python
15 lines
424 B
Python
from gpiozero import LEDBoard, MotionSensor
|
|
from gpiozero.pins.pigpio import PiGPIOFactory
|
|
from signal import pause
|
|
|
|
ips = ['192.168.1.3', '192.168.1.4', '192.168.1.5', '192.168.1.6']
|
|
remotes = [PiGPIOFactory(host=ip) for ip in ips]
|
|
|
|
button = Button(17) # button on this pi
|
|
buzzers = [Buzzer(pin, pin_factory=r) for r in remotes] # buzzers on remote pins
|
|
|
|
for buzzer in buzzers:
|
|
buzzer.source = button.values
|
|
|
|
pause()
|