UIFlow Guide
Control multiple channels (up to 512 channels) of a device through the DMX protocol, sending specified values (e.g., channel 0 to 255 represent RGB values of light colors) to adjust the device's state. This is commonly used for stage lighting control or other digital equipment adjustment.
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit
setScreenColor(0x222222)
dmx_0 = unit.get(unit.DMX, unit.PORTA)
dmx_0.init_dmx(1, 1)
while True:
dmx_0.write_dmx_value(1, 136)
wait(1)
dmx_0.write_dmx_value(512, 255)
wait(1)
dmx_0.clear_dmx_buffer()
wait(1)
wait_ms(2)
dmx_0.init_dmx(1, 1)
dmx_0
, set it to MASTER mode, and specify the use of UART 1 for communication.dmx_0.deinit()
dmx_0
, stopping the module's operation and releasing the associated resources.dmx_0.write_dmx_value(1, 0)
dmx_0.clear_dmx_buffer()
dmx_0.read_dmx_value(1)
print
(returns the value as an integer).