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 9 insertions and 5 deletions:
0 comments (0 inline, 0 general)
light9/io/__init__.py
Show inline comments
 
@@ -64,11 +64,15 @@ class UsbDMX(BaseIO):
 

	
 
    def _dmx(self):
 
        if self.out is None:
 
            sys.path.append("dmx_usb_module")
 
            from dmx import Dmx
 
            self.out = Dmx(self.port)
 
            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:
 
@@ -78,7 +82,7 @@ class UsbDMX(BaseIO):
 
        packet = '\x00' + ''.join([chr(int(lev * 255 / 100)) 
 
                                  for lev in levels]) + "\x55"
 
        self._dmx().write(packet)
 

	
 
        
 
class SerialPots(BaseIO):
 
    """
 
    this is a dummy object (that returns zeros forever) until you call startup()
0 comments (0 inline, 0 general)