From 173abb23cb2dc3a50bea5088e25e3a2de010f192 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 29 Mar 2012 23:55:20 +0200 Subject: digital/io-hub/tools: add output --- digital/io-hub/tools/io_hub/io_hub.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'digital/io-hub/tools') diff --git a/digital/io-hub/tools/io_hub/io_hub.py b/digital/io-hub/tools/io_hub/io_hub.py index d7407cb8..bf65b199 100644 --- a/digital/io-hub/tools/io_hub/io_hub.py +++ b/digital/io-hub/tools/io_hub/io_hub.py @@ -49,6 +49,12 @@ class Proto: def goto (self, x, y, backward): self.proto.send ('m', 'hhB', x, y, backward) + def output (self, mask, action): + m = { 'clear': 0, 'set': 1, 'toggle': 2 } + if action in m: + action = m[action] + self.proto.send ('o', 'Lb', mask, action) + def close (self): self.reset () self.proto.wait (lambda: True) -- cgit v1.2.3