UIFlow Guide
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit
setScreenColor(0x272727)
mini_oled_0 = unit.get(unit.MINI_OLED, unit.PORTA)
i = None
# Describe this function...
def text_scroll():
global i
mini_oled_0.fill(0)
mini_oled_0.text('WELCOME', 8, 4, 1)
mini_oled_0.text('M5', 30, 18, 1)
mini_oled_0.text('MINI OLED', 0, 32, 1)
mini_oled_0.show()
for count in range(5):
mini_oled_0.invert(1)
mini_oled_0.show()
wait_ms(250)
mini_oled_0.invert(0)
mini_oled_0.show()
wait_ms(250)
for i in range(11):
mini_oled_0.scroll(i, i)
mini_oled_0.show()
wait_ms(250)
def buttonA_wasPressed():
global i
text_scroll()
pass
btnA.wasPressed(buttonA_wasPressed)
text_scroll()
wait_ms(200)
mini_oled_0.contrast(150)
mini_oled_0.invert(1)
mini_oled_0.power_ctrl(0x00)
mini_oled_0.scroll(0, 0)
mini_oled_0.show()
mini_oled_0.fill(1)
mini_oled_0.fill_rect(0, 0, 0, 0, 1)
mini_oled_0.hline(0, 0, 0, 1)
mini_oled_0.line(0, 0, 0, 0, 1)
mini_oled_0.pixel(0, 0, 1)
mini_oled_0.rect(0, 0, 0, 0, 1)
mini_oled_0.text('', 0, 0, 1)
mini_oled_0.vline(0, 0, 0, 1)