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
		
	
	
		
			355 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			355 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from gpiozero import LEDBarGraph
 | |
| from time import sleep
 | |
| 
 | |
| graph = LEDBarGraph(5, 6, 13, 19, 26, pwm=True)
 | |
| 
 | |
| graph.value = 1/10  # (0.5, 0, 0, 0, 0)
 | |
| sleep(1)
 | |
| graph.value = 3/10  # (1, 0.5, 0, 0, 0)
 | |
| sleep(1)
 | |
| graph.value = -3/10  # (0, 0, 0, 0.5, 1)
 | |
| sleep(1)
 | |
| graph.value = 9/10  # (1, 1, 1, 1, 0.5)
 | |
| sleep(1)
 | |
| graph.value = 95/100  # (1, 1, 1, 1, 0.75)
 | |
| sleep(1)
 |