def connectDevices(): try: Arduino.disconnect() except: pass Arduino.connect('/dev/%s' % app.getArdPort(), 250000) try: EntTec.disconnect() except: pass EntTec.connect('/dev/%s' % app.getEntPort()) #'/dev/tty.usbserial-EN172718' app.drawConnect()
messages = [0] * 64 mode = sys.argv[1] channelColours = ['Red','Green','Blue','White'] numberColours = len(channelColours) defaultMap = {} for channelN,channel in enumerate(channelColours): defaultMap[channel] = range(channelN,64*numberColours,numberColours) DMXValues = [255,255,255,255] EntTec = EntTec() EntTec.connect('/dev/tty.usbserial-EN172718') 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()