The 2.4 " display has a pixel resolution of 320x240 pixels. It is controlled by an ili9431 display driver and provides a touch screen based on the xpt2046 controller. Information about the display and its pin-outs can be found at https://docs.wemos.cc/en/latest/d1_mini_shield/tft_2_4.html.
With a high resolution screen and a touch screen the display can be used to provide a local Graphical User Interface (GUI) for your IoT project.
The Lolin 2.4" display uses the following pinout:
TFT board function | CPU Pin | |
TFT_LED | NC* (D1,D2,D3,D4) | (GPIO 22, GPIO 21, GPIO 17(WROOM) or GPIO 25 (WROVER), GPIO 16 (WROOM) or GPIO 4 (WROVER)) |
TFT_RST | RST* (D1,D3,D4) | (GPIO 22, GPIO 17(WROOM) or GPIO 25 (WROVER), GPIO 16 (WROOM) or GPIO 4 (WROVER)) |
TFT_DC | D8 | GPIO 5 |
MOSI | D7 | GPIO 23 |
MISO | D6 | GPIO 19 |
SCK | D5 | GPIO 18 |
TFT_CS | D0 | GPIO 26 |
TS_CS | (D1,D2,D3*,D4) | (GPIO 22, GPIO 21, GPIO 17(WROOM) or GPIO 25 (WROVER), GPIO 16 (WROOM) or GPIO 4 (WROVER)) |
I modified the ili9431 driver for lvgl (lib/lv_bindings/drivers/esp32/ili9XXX) to reflect the above pin-outs:
miso=19, mosi=23, clk=18, cs=26, dc=5, rst=-1, power=-1, backlight=-1, spihost=esp.VSPI_HOST, mhz=40, factor=4, hybrid=True
A graphical user interface library lvgl has been developed in C and is now available with a MicroPython binding, such that the library structs and functions are available in MicroPython. In order for this to work we need a modified !MicroPython binary with lvgl
and the lv_bindings
included in the code. The original lvgl documentation is available at https://docs.lvgl.io/v7/en/html/intro/index.html.
The same text but adapted to the MicroPython binding will be available on this TWiki (currently under development)