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)
		
			
				
	
	
		
			16 lines
		
	
	
		
			343 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			343 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from gpiozero import LEDBarGraph
 | |
| from time import sleep
 | |
| 
 | |
| graph = LEDBarGraph(5, 6, 13, 19, 26, 20)
 | |
| 
 | |
| graph.value = 1  # (1, 1, 1, 1, 1, 1)
 | |
| sleep(1)
 | |
| graph.value = 1/2  # (1, 1, 1, 0, 0, 0)
 | |
| sleep(1)
 | |
| graph.value = -1/2  # (0, 0, 0, 1, 1, 1)
 | |
| sleep(1)
 | |
| graph.value = 1/4  # (1, 0, 0, 0, 0, 0)
 | |
| sleep(1)
 | |
| graph.value = -1  # (1, 1, 1, 1, 1, 1)
 | |
| sleep(1)
 |