-
-
Save Josverl/97ac9c8ceaf0c61bb7b9cc5eb2c68174 to your computer and use it in GitHub Desktop.
M5Stack mimimal LVGL demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ili9XXX import ili9341, LANDSCAPE | |
import lvgl as lv | |
import fs_driver | |
disp = None | |
def start(): | |
global disp | |
if not disp: | |
# disp = st7789(width=135, height=240, double_buffer = False, | |
# factor=8, rot=st7789.LANDSCAPE) | |
disp = ili9341( | |
mosi=23, | |
miso=19, | |
clk=18, | |
dc=27, | |
cs=14, | |
rst=33, | |
power=-1, | |
backlight=32, | |
rot=LANDSCAPE, | |
width=320, | |
height=240, | |
) | |
fs_drv = lv.fs_drv_t() | |
fs_driver.fs_register(fs_drv, "S") | |
lv.init() | |
start() | |
# Creating a screen with a button and a label | |
scr = lv.obj() | |
btn = lv.btn(scr) | |
btn.align(lv.ALIGN.CENTER, 0, 0) | |
label = lv.label(btn) | |
label.set_text("Button") | |
# Load the screen | |
lv.scr_load(scr) | |
#Screen stays black :-( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment