Changeset - 22b3563bc3cd
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 11 years ago 2014-06-14 23:06:22
drewp@bigasterisk.com
clamp blacklight output val
Ignore-this: bdea33f245693ed1623b8cd7929f71fe
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/effecteval/effectloop.py
Show inline comments
 
@@ -193,13 +193,15 @@ class LedLoop(EffectLoop):
 

	
 
    @inlineCallbacks
 
    def sendOutput(self, combined):
 
        for which, px255 in combined.items():
 
            if which == 'blacklight':
 
                if px255 != self.lastSentBacklight:
 
                    yield succeed(self.serialWrite(self.boards['L'], '\x60\x01' + chr(px255)))
 
                    b = min(255, max(0, px255))
 
                    yield succeed(self.serialWrite(self.boards['L'],
 
                                                   '\x60\x01' + chr(b)))
 
                    self.lastSentBacklight = px255
 
            else:
 
                board = self.boards[which]
 
                msg = '\x60\x00' + px255.reshape((-1,)).tostring()
 
                # may be stuttering more, and not smoother
 
                #yield threads.deferToThread(self.serialWrite, board, msg)
0 comments (0 inline, 0 general)