UIFlow Guide
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit
setScreenColor(0x222222)
RS485_0 = unit.get(unit.RS485, unit.PORTC)
RS485_0.init(1, baudrate=9600, data_bits=8, stop_bits=1, parity=None, ctrl_pin=None)
while True:
RS485_0.write('Hello M5Stack')
print((str('Msg:') + str((RS485_0.read()))))
wait(1)
wait_ms(2)
RS485_0.init(1, baudrate=9600, data_bits=8, stop_bits=1, parity=None, ctrl_pin=None)
print(RS485_0.any())
print(RS485_0.read())
print(RS485_0.readline())
print(RS485_0.read(10))
print(RS485_0.read_coils(1, 1, 0))
print(RS485_0.read_discrete_inputs(1, 1, 0))
print(RS485_0.read_holding_registers(1, 1, 0, True))
print(RS485_0.read_input_registers(1, 1, 0, True))
RS485_0.write('')
RS485_0.write(''+"\r\n")
print(RS485_0.write_multiple_coils(1, 1, 0))
print(RS485_0.write_multiple_registers(1, 1, 0, True))
RS485_0.write(bytes([0, 0, 0]))
print(RS485_0.write_single_coil(1, 1, 0))
print(RS485_0.write_single_register(1, 1, 0, True))