UIFlow Guide
Sets the Mini Encoder communication address and LED color to white. The encoder value and button status are continuously printed in the serial output.
from m5stack import *
from m5ui import *
from uiflow import *
import hat
setScreenColor(0x111111)
hat_mini_encoderc_0 = hat.get(hat.MINI_ENCODERC)
hat_mini_encoderc_0.init_i2c_address(0x42)
hat_mini_encoderc_0.set_LED_RGB24(50, 50, 50)
while True:
print(hat_mini_encoderc_0.get_counter_value())
print(hat_mini_encoderc_0.get_button_status())
wait_ms(2)
hat_mini_encoderc_0.init_i2c_address(0x42)
0x42
.hat_mini_encoderc_0.get_button_status()
hat_mini_encoderc_0.get_counter_value()
hat_mini_encoderc_0.get_device_status()
hat_mini_encoderc_0.get_increment_value()
hat_mini_encoderc_0.reset_counter_value()
hat_mini_encoderc_0.set_counter_value(0)
0
.hat_mini_encoderc_0.set_i2c_address(new_address)
new_address
.hat_mini_encoderc_0.set_LED_RGB24(red, green, blue)