LCD Unit

Unit LCD is a 1.14 inch color LCD expansion screen unit. It adopts ST7789V2 drive scheme, the resolution is 135*240, and it supports RGB666 display (262,144 colors). The internal integration of ESP32-PICO control core (built-in firmware, display development is more convenient), support through I2C (addr: 0x3E) communication interface for control and firmware upgrades. The back of the screen is integrated with a magnetic design, which can easily adsorb the metal surface for fixing. The LCD screen extension is suitable for embedding in various instruments or control devices that need to display simple content as a display panel.

Support the following products:

LCDUnit

Micropython Example:

 1# SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
 2#
 3# SPDX-License-Identifier: MIT
 4
 5import os, sys, io
 6import M5
 7from M5 import *
 8from hardware import I2C
 9from hardware import Pin
10from unit import LCDUnit
11
12
13label0 = None
14label1 = None
15i2c0 = None
16lcd_0 = None
17
18
19def setup():
20    global label0, label1, i2c0, lcd_0
21
22    M5.begin()
23    Widgets.fillScreen(0x222222)
24    label0 = Widgets.Label("CoreS3", 127, 109, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18)
25
26    i2c0 = I2C(0, scl=Pin(1), sda=Pin(2), freq=100000)
27    lcd_0 = LCDUnit(i2c0, 0x3E)
28    label1 = Widgets.Label("LCD", 48, 109, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18, lcd_0)
29
30
31def loop():
32    global label0, label1, i2c0, lcd_0
33    M5.update()
34
35
36if __name__ == "__main__":
37    try:
38        setup()
39        while True:
40            loop()
41    except (Exception, KeyboardInterrupt) as e:
42        try:
43            from utility import print_error_msg
44
45            print_error_msg(e)
46        except ImportError:
47            print("please update to latest firmware")

UIFLOW2 Example:

example.png

cores3_lcd_example.m5f2

class LCDUnit

Constructors

class LCDUnit(i2c, address: int = 0x3e, freq: int = 400000)

Initialize the Unit LCD

Parameters:
  • i2c (I2C) – the I2C object.

  • address (int) – I2C address of the Unit LCDUnit, default is 0x3e.

  • freq (int) – I2C frequency of the Unit LCDUnit.

UIFLOW2:

init.png