Hi
I need help to get started please.
I have built the firmware as follows: https://github.com/lvgl/lv_micropython
I don’t understand the documentation because when I copy the basic example
from ili9XXX import ili9341
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'ili9XXX'
I certainly missed something
The only code I can get to work is
import time
from machine import SPI, Pin
import ili9xxx
import lvgl as lv
import sys
lv.init()
spi = SPI(
0,
baudrate=24_000_000,
sck=Pin(18),
mosi=Pin(19),
miso=Pin(16),
)
drv = ili9xxx.Ili9341(spi=spi, cs=17, dc=15, rst=14)
scr = lv.obj()
btn = lv.btn(scr)
btn.set_style_bg_color(lv.color_hex(0xFF0000), lv.PART.MAIN | lv.STATE.DEFAULT)
scr.set_style_bg_color(lv.color_hex(0x000000), lv.PART.MAIN | lv.STATE.DEFAULT)
label = lv.label(btn)
label.set_text("Hello World!")
btn.set_style_width(120, lv.PART.MAIN | lv.STATE.DEFAULT)
btn.set_style_height(35, lv.PART.MAIN | lv.STATE.DEFAULT)
bh = 18
bw = 60
by = 160 - bh
bx = 240 - bw
btn.set_x(bx)
btn.set_y(by)
lv.scr_load(scr)
start_time = time.ticks_ms()
while True:
end_time = time.ticks_ms()
diff = time.ticks_diff(end_time, start_time)
if diff >= 1:
start_time = end_time
lv.tick_inc(diff)
lv.task_handler()
but I had to copy it to my flash =>
ili9xxx.py
st77xx.py
lv_utils.py
I’d like to understand what I’ve missed and have a very simple example to start with
Thanks in advance