if mode == "mirza": Arduino = Arduino() Arduino.connect('/dev/tty.usbmodemfa141',250000) pins = [59, 51, 43, 35, 25, 17, 9, 1] pins.reverse() print Arduino.cue() while True: sender = [] output = Arduino.readSequence() print output for i in output: sender.append(int(i) * 83) EntTec.sendLights(pins,sender) elif mode == "boulez": IRCAM = IRCAM() IRCAM.connect('0.0.0.0',7007) while True: message = IRCAM.getMessage() if message != None: print "in" + str(message) message = map(message, 0, 90, 0, 63) #messages = [0] * 64 for cN,channel in enumerate(messages): if channel != 0: messages[cN] -= 2 message = clamp(message, 0, 63) messages[message] = 20 #EntTec.senddmx(range(1,65),messages) EntTec.senddmx(range(1,65),messages) elif mode == "test": while True:
def startIrcam(): HaroonThread.stop() IRCAM.disconnect() IRCAM.connect('0.0.0.0',7000) app.drawControl(ircam='#F00') IrcamThread.start()