mirror of
				https://github.com/KevinMidboe/python-gpiozero.git
				synced 2025-10-29 17:50:37 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			10 lines
		
	
	
		
			317 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			317 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import gpiozero
 | 
						|
from gpiozero import TrafficHat
 | 
						|
from gpiozero.pins.pigpio import PiGPIOFactory
 | 
						|
from time import sleep
 | 
						|
 | 
						|
remote_factory = PiGPIOFactory(host='192.168.1.3')
 | 
						|
 | 
						|
th_1 = TrafficHat()  # traffic hat using local pins
 | 
						|
th_2 = TrafficHat(pin_factory=remote_factory)  # traffic hat on 192.168.1.3 using remote pins
 |