mirror of
				https://github.com/KevinMidboe/python-gpiozero.git
				synced 2025-10-29 17:50:37 +00:00 
			
		
		
		
	Makes it much easier to test things - no copying'n'pasting just run the examples straight from the dir (after wiring stuff up)
		
			
				
	
	
		
			25 lines
		
	
	
		
			313 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			313 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from gpiozero import LED
 | |
| from time import sleep
 | |
| 
 | |
| red = LED(2)
 | |
| amber = LED(3)
 | |
| green = LED(4)
 | |
| 
 | |
| green.on()
 | |
| amber.off()
 | |
| red.off()
 | |
| 
 | |
| while True:
 | |
|     sleep(10)
 | |
|     green.off()
 | |
|     amber.on()
 | |
|     sleep(1)
 | |
|     amber.off()
 | |
|     red.on()
 | |
|     sleep(10)
 | |
|     amber.on()
 | |
|     sleep(1)
 | |
|     green.on()
 | |
|     amber.off()
 | |
|     red.off()
 |