Changeset - 1382cb43a3ca
[Not reviewed]
default
0 1 0
Drew Perttula - 9 years ago 2016-05-14 23:56:02
drewp@bigasterisk.com
dmxserver -d udmx to talk to the first udmx usb adapter found
Ignore-this: 9495a02620509bbd03271b47f9ab3282
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/io/__init__.py
Show inline comments
 
@@ -61,18 +61,22 @@ class UsbDMX(BaseIO):
 
        self.port = port
 
        self.out = None
 
        self.dimmers = dimmers
 

	
 
    def _dmx(self):
 
        if self.out is None:
 
            if self.port == 'udmx':
 
                from udmx import Udmx
 
                self.out = Udmx()
 
                self.out.write = self.out.SendDMX
 
            else:
 
            sys.path.append("dmx_usb_module")
 
            from dmx import Dmx
 
            self.out = Dmx(self.port)
 
        return self.out
 
        
 

	
 
    def sendlevels(self, levels):
 
        if self.dummy:
 
            return
 
        # I was outputting on 76 and it was turning on the light at
 
        # dmx75. So I added the 0 byte.
 
        packet = '\x00' + ''.join([chr(int(lev * 255 / 100)) 
0 comments (0 inline, 0 general)