pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit LCD

Example

Draw basic graphics and text

from m5stack import *
from m5stack_ui import *
from uiflow import *
import unit

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
lcd_0 = unit.get(unit.LCD, unit.PORTA)

lcd_0.fill(0x999999)
lcd_0.text('M5Stack', 0, 0, 0xff0000)
lcd_0.line(0, 10, 50, 10, 0xff0000)
lcd_0.rect(10, 10, 20, 20, 0xff0000)
lcd_0.brightness(0)
lcd_0.show_on()

API

lcd_0.init_display(135, 240, 1)
  • Initialize and Define Unit Screen Size
lcd_0.brightness(0)
  • Set Display Brightness
lcd_0.fill(0xff0000)
  • Set Screen Color Fill
lcd_0.fill(0xff0000)
  • Fill Specified Area with Color
    • plette
    • RGB
    • Hex
lcd_0.fill_rect(0, 0, 0, 0, 0xff0000)
  • Repeat of Fill Specified Area
lcd_0.fill_rect(0, 0, 0, 0, 0xff0000)
  • Repeat of Fill Specified Area
    • plette
    • RGB
    • Hex
lcd_0.rotate(4)
  • Set screen rotation
    • Flip(1~6)
lcd_0.hline(0, 0, 0, 0xff0000)
  • Draw a horizontal line
lcd_0.hline(0, 0, 0, 0xff0000)
  • Draw a horizontal line (duplicate entry)
    • plette
    • RGB
    • Hex
lcd_0.line(0, 0, 0, 0, 0xff0000)
  • Draw a straight line from point to point
lcd_0.line(0, 0, 0, 0, 0xff0000)
  • Draw a straight line from point to point (duplicate entry)
    • plette
    • RGB
    • Hex
lcd_0.pixel(0, 0, 0xff0000)
  • Draw a pixel
lcd_0.pixel(0, 0, 0xff0000)
  • Draw a pixel (duplicate entry)
    • plette
    • RGB
    • Hex
lcd_0.rect(0, 0, 0, 0, 0xff0000)
  • Draw a square
lcd_0.rect(0, 0, 0, 0, 0xff0000)
  • Draw a square (duplicate entry)
    • plette
    • RGB
    • Hex
lcd_0.rotate(0)
  • Set rotation angle (0, 90, 180, 270)
lcd_0.show_on()
  • Turn on the device
lcd_0.sleep(0)
  • Set sleep time
lcd_0.text('', 0, 0, 0xff0000)
  • Draw text
lcd_0.text('', 0, 0, 0xff0000)
  • Draw text (duplicate entry)
    • plette
    • RGB
    • Hex
lcd_0.vline(0, 0, 0, 0xff0000)
  • Draw a vertical line
lcd_0.vline(0, 0, 0, 0xff0000)
  • Draw a vertical line (duplicate entry)
    • plette
    • RGB
    • Hex
On This Page