Lixada Usb Dmx 512 Driver — Windows 10
DMX_CHANNELS = 512 BREAK_TIME = 0.0001 # 100µs break MAB_TIME = 0.000012 # 12µs mark after break
def _continuous_sender(self, fps): interval = 1.0 / fps while self.running: start = time.perf_counter() self.send_frame() elapsed = time.perf_counter() - start if elapsed < interval: time.sleep(interval - elapsed) lixada usb dmx 512 driver windows 10
def start_continuous_sending(self, fps=44): """ Start background thread sending DMX continuously. Standard DMX refresh rate is ~44Hz (22-44 Hz typical). """ if self.running: return self.running = True self._sender_thread = threading.Thread(target=self._continuous_sender, args=(fps,), daemon=True) self._sender_thread.start() print(f"Continuous DMX sending started at fps FPS") DMX_CHANNELS = 512 BREAK_TIME = 0
def __init__(self, com_port=None, auto_find=True): """ Args: com_port: e.g., 'COM3'. If None and auto_find=True, searches for CP2102/CH340. auto_find: Automatically detect the dongle. """ self.serial = None self.running = False self.dmx_data = bytearray([0] * self.DMX_CHANNELS) self.lock = threading.Lock() if auto_find and com_port is None: com_port = self.find_lixada_port() if com_port is None: raise RuntimeError("No Lixada DMX dongle found. Check USB connection.") self.com_port = com_port self._open_serial() If None and auto_find=True, searches for CP2102/CH340
