Compare commits
	
		
			No commits in common. '57559ea70aa2f27fcc15aacf2a9e2ededca0d4e8' and 'd135c8c24f53296df34d26c7275a6d7970dc8bdf' have entirely different histories. 
		
	
	
		
			57559ea70a
			...
			d135c8c24f
		
	
		
	
				 1 changed files with 0 additions and 35 deletions
			
			
		@ -1,35 +0,0 @@ | 
				
			||||
from lib.Program import Program | 
				
			||||
from rpi_ws281x import Color | 
				
			||||
import time | 
				
			||||
 | 
				
			||||
 | 
				
			||||
def name(): | 
				
			||||
    return 'RGBT Gaynbow' | 
				
			||||
 | 
				
			||||
 | 
				
			||||
def wheel(pos): | 
				
			||||
    """Generate rainbow colors across 0-255 positions.""" | 
				
			||||
    if pos < 85: | 
				
			||||
        return Color(pos * 3, 255 - pos * 3, 0) | 
				
			||||
    elif pos < 170: | 
				
			||||
        pos -= 85 | 
				
			||||
        return Color(255 - pos * 3, 0, pos * 3) | 
				
			||||
    else: | 
				
			||||
        pos -= 170 | 
				
			||||
        return Color(0, pos * 3, 255 - pos * 3) | 
				
			||||
 | 
				
			||||
 | 
				
			||||
class Gaynbow(Program): | 
				
			||||
    def run(self, args: [] = None): | 
				
			||||
        wait_ms = 20 | 
				
			||||
        iterations = 5 | 
				
			||||
        while self.get_loop().status(): | 
				
			||||
            """Draw rainbow that uniformly distributes itself across all pixels.""" | 
				
			||||
            for j in range(256 * iterations): | 
				
			||||
                if not self.get_loop().status(): | 
				
			||||
                    break | 
				
			||||
                for i in range(self._lm.count_pixels()): | 
				
			||||
                    self._lm.set_pixel_color(i, wheel( | 
				
			||||
                        (int(i * 256 / self._lm.count_pixels()) + j) & 255)) | 
				
			||||
                self._lm.show() | 
				
			||||
                time.sleep(wait_ms / 1000.0) | 
				
			||||
					Loading…
					
					
				
		Reference in new issue