""" Simple rgb color fade tested with the monoprice rgbawuv Requires python3.7 for the async coroutine syntax; should be trivial to backport though Requires: libusb==1.0.22b4 numpy==1.16.3 pyusb==1.0.2 scikit-image==0.15.0 udmx-pyusb==2.0.0 """ import asyncio from pyudmx import pyudmx from skimage import color async def make_colors(): for idx in range(20): for hue in range(0, 255, 1): yield color.hsv2rgb([[[hue/255., 1., 1.]]])[0][0] await asyncio.sleep(0.02) async def main(): device = pyudmx.uDMXDevice() if not device.open(): raise RuntimeError("didn't open device") async for rgb in make_colors(): dmxvals = [int(255 * val) for val in rgb] + [0] * 8 print(f'sending {dmxvals}') device.send_multi_value(channel=1, values=dmxvals) asyncio.run(main())