Lixada Usb Dmx 512 Driver Windows 10 -

def find_lixada_port(self): """Auto-detect CP2102 or CH340 serial port.""" ports = serial.tools.list_ports.comports() for port in ports: # CP2102 or CH340 typically used in Lixada dongles if 'CP210' in port.description or 'CP210' in port.product or \ 'CH340' in port.description or 'CH34' in port.vid: return port.device # Fallback: any USB serial port (user confirms) if 'USB Serial' in port.description or 'UART' in port.description: print(f"Possible DMX port found: port.device - port.description") # Return first candidate return port.device return None

def set_channels(self, channel_values_dict): """Set multiple channels at once.""" for ch, val in channel_values_dict.items(): self.set_channel(ch, val) lixada usb dmx 512 driver windows 10

print("Fading RGB channels 1(R),2(G),3(B)... Press Ctrl+C to stop") try: step = 0 while True: # Simple sine fade import math r = int((math.sin(step * 0.02) + 1) / 2 * 255) g = int((math.sin(step * 0.02 + 2.0) + 1) / 2 * 255) b = int((math.sin(step * 0.02 + 4.0) + 1) / 2 * 255) dmx.set_channels(1: r, 2: g, 3: b) time.sleep(0.05) step += 1 except KeyboardInterrupt: print("\nFade stopped") def demo_strobe(): """Quick strobe on channel 4.""" with LixadaDMX() as dmx: dmx.start_continuous_sending(fps=50) print("Strobe on channel 4 (0/255)... Ctrl+C stop") try: while True: dmx.set_channel(4, 255) time.sleep(0.05) dmx.set_channel(4, 0) time.sleep(0.05) except KeyboardInterrupt: pass Args: channel: 1

def set_channel(self, channel, value): """ Set DMX channel value. Args: channel: 1..512 value: 0..255 """ if channel < 1 or channel > self.DMX_CHANNELS: raise ValueError(f"Channel must be 1..self.DMX_CHANNELS") if value < 0 or value > 255: raise ValueError("Value must be 0..255") with self.lock: self.dmx_data[channel - 1] = value 1 or channel &gt