Mercurial > code > home > repos > light9
changeset 1153:22b3563bc3cd
clamp blacklight output val
Ignore-this: bdea33f245693ed1623b8cd7929f71fe
author | drewp@bigasterisk.com |
---|---|
date | Sat, 14 Jun 2014 23:06:22 +0000 |
parents | eb8c4352798c |
children | 1e97f96ee00c |
files | light9/effecteval/effectloop.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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]