# HG changeset patch # User drewp@bigasterisk.com # Date 1402787182 0 # Node ID 22b3563bc3cdf280403dabb080e8528e22a592c3 # Parent eb8c4352798cf9754e2fc4ae4c9727e2111beabe clamp blacklight output val Ignore-this: bdea33f245693ed1623b8cd7929f71fe diff -r eb8c4352798c -r 22b3563bc3cd light9/effecteval/effectloop.py --- a/light9/effecteval/effectloop.py Sat Jun 14 23:03:46 2014 +0000 +++ b/light9/effecteval/effectloop.py Sat Jun 14 23:06:22 2014 +0000 @@ -196,7 +196,9 @@ 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]