ESP32 Terminal and micropython
I have used ESP32 Terminal 3.5" (DLC35010R) successfully with Arduino IDE and VS Code.
I tried to do some test with Micropython, but without success. I have used both bin files from https://github.com/Elecrow-RD/esp32-terminal/tree/master/RGB/5%E3%80%81micropython.
together with the Hello World LVGL example:
import lvgl as lv
lv.init()
scr = lv.obj()
btn = lv.btn(scr)
btn.align(lv.ALIGN.CENTER, 0, 0)
label = lv.label(btn)
label.set_text('Hello World!')
lv.screen_load(scr)
This program crashes at the line "scr = lv.obj()" and the ESP Terminal reboots.
If I look into the file tft_config.py the pin definitions don't fit to the pins as used in the arduino files i use. So my questions:
- Are above mentioned github files really for the ESP32 Terminal 3.5" / DLC35010R
- What is the difference between the -A.bin and the -B.bin files?
- Are there any source files available to compile the micropython including LVGL for 16bit RGB interface as used on the ESP32 Terminal?
Best Regards from Germany
Herbert
Comments
Hello @hemonu ,
1. The pins are defined according to the GPIO numbers.
2. A-bin is the firmware that includes the driver, and B-bin is the firmware that does not include the driver.
3. For the operation steps, you can refer to the esp32 4.3-inch hmi tutorial:
As this display uses 16bit parallel interface it's a bit more than just the pin numbers ;-)
It finally got it working with this tft_config.py:
import lcd
import machine
def config():
bus_tft = lcd.8080(
data = (
machine.Pin(47), \
machine.Pin(21), \
machine.Pin(14), \
machine.Pin(13), \
machine.Pin(12), \
machine.Pin(11), \
machine.Pin(10), \
machine.Pin(9), \
machine.Pin(3), \
machine.Pin(8), \
machine.Pin(16), \
machine.Pin(15), \
machine.Pin(7), \
machine.Pin(6), \
machine.Pin(5), \
machine.Pin(4)), \
dc = machine.Pin(45), \
write = machine.Pin(18),\
read = machine.Pin(48),\
cs = None,\
pclk = 20000000, \
width = 480, \
height = 320,\
swap_color_bytes = False,\
cmd_bits = 8,\
param_bits = 8\
)
tft = lcd.ILI9488(
bus = bus_tft, \
reset = None, \
backlight = machine.Pin(46), \
reset_level = False, \
color_space = RGB565, \
bpp = 16
)
tft.reset()
tft.init()
tft.backlight_on()
return tft