UIFlow Guide
Matrix flowing light
from m5stack import *
from m5stack_ui import *
from uiflow import *
import time
import unit
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
neopixel_0 = unit.get(unit.NEOPIXEL, unit.PORTB, 10)
R = None
G = None
B = None
i = None
import random
while True:
R = random.randint(0, 255)
G = random.randint(0, 255)
B = random.randint(0, 255)
for i in range(1, 31):
neopixel_0.setColorFrom(1,i,(R << 16) | (G << 8) | B)
wait_ms(500)
for i in range(1, 31):
neopixel_0.setColorFrom(1, i, 0x000000)
wait_ms(500)
wait_ms(2)
neopixel_0.setBrightness(20)
neopixel_0.setColor(1, 0xff0000)
neopixel_0.setColorAll(0xff0000)
neopixel_0.setColorAll(0xff0000)
neopixel_0.setColorFrom(1, 5, 0xff0000)
neopixel_0.setColorFrom(1, 5, 0xff0000)
neopixel_0.setColorFrom(1, 5, 0x000000)
neopixel_0.setColor(1, 0xff0000)
neopixel_0.setShowLock(True)
neopixel_0.setShowLock(True)
neopixel_0.setShowLock(True)
neopixel_0.show()