def cmd_fn(self, fn): logging.debug("cmd %s" % fn) if CMD_PORT_MAP.has_key(fn): port = CMD_PORT_MAP[fn] GPIO.output(port, ~GPIO.input(port) & 0x1 ) # toggle
def cmd_direction(self, direction): logging.debug("cmd %s" % direction) if CMD_PORT_MAP.has_key(direction): # run blink in background Thread(target=blink, args=(CMD_PORT_MAP[direction],)).start()