Changeset - da8a4696227f
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 10 years ago 2015-06-13 06:28:30
drewp@bigasterisk.com
make the rgb strip work more like the neo ones
Ignore-this: e272be49d61373e188f7da5de19c273b
2 files changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/Effects.py
Show inline comments
 
@@ -18,7 +18,7 @@ def register(f):
 
@register
 
class Strip(object):
 
    """list of r,g,b tuples for sending to an LED strip"""
 
    which = 'L' # LR means both
 
    which = 'L' # LR means both. W is the wide one
 
    pixels = []
 
    @classmethod
 
    def solid(cls, which='L', color=(1,1,1), hsv=None):
light9/effecteval/effectloop.py
Show inline comments
 
@@ -226,7 +226,7 @@ class LedLoop(EffectLoop):
 
    def combineOutputs(self, outputs):
 
        combined = {'L': Z, 'R': Z,
 
                    'blacklight0': 0, 'blacklight1': 0,
 
                    'rgb': numpy.zeros((1, 3), dtype=numpy.float16)}
 
                    'W': numpy.zeros((1, 3), dtype=numpy.float16)}
 
        
 
        for out in outputs:
 
            log.debug('combine output %r', out)
 
@@ -236,7 +236,8 @@ class LedLoop(EffectLoop):
 
            elif isinstance(out, Effects.Strip):
 
                pixels = numpy.array(out.pixels, dtype=numpy.float16)
 
                for w in out.which:
 
                    combined[w] = numpy.maximum(combined[w], pixels)
 
                    combined[w] = numpy.maximum(
 
                        combined[w], pixels[:1,:] if w == 'W' else pixels)
 
                
 
        return combined
 

	
 
@@ -247,7 +248,7 @@ class LedLoop(EffectLoop):
 
                ('setStrip', (1,), combined['R']),
 
                ('setUv', (0,), combined['blacklight0']),
 
                ('setUv', (1,), combined['blacklight1']),
 
                ('setRgb', (), combined['rgb']),
 
                ('setRgb', (), combined['W']),
 
            ]:
 
            key = (meth, selectArgs)
 
            compValue = value.tolist() if isinstance(value, numpy.ndarray) else value
0 comments (0 inline, 0 general)