hub.lcd
The hub’s screen.
Turn the backlight on and off or change its brightness. To draw on the
screen use the lvgl module, which is ready as soon as your program
starts. While your program runs, call lvgl.timer_handler() regularly
(for example every 5 ms in your main loop) so the screen keeps updating.
Functions marked Advanced talk to the screen hardware directly and are only needed for testing or new screen types.
Functions
|
Set the screen brightness from 0 (off) to 255 (brightest). |
|
Advanced: send a raw command (and optional data bytes) to the screen chip. |
|
Advanced: fill the whole screen with one color, skipping LVGL. |
|
Advanced: restart the screen's drawing system (LVGL). |
|
Advanced: run one screen update step. |
|
Turn the screen's backlight off. |
|
Turn the screen's backlight fully on. |
|
Advanced: restart the screen hardware. |
|
Advanced: swap all screen colors for their opposites. |
|
Advanced: set the screen's orientation/mirroring register (MADCTL). |
|
Advanced: shift the picture on the panel by |
Module Contents
- hub.lcd.backlight(duty: int) None[source]
Set the screen brightness from 0 (off) to 255 (brightest).
- hub.lcd.cmd(cmd: int, data: bytes = b'') None[source]
Advanced: send a raw command (and optional data bytes) to the screen chip.
- hub.lcd.fill(rgb565: int) None[source]
Advanced: fill the whole screen with one color, skipping LVGL.
The color is a 16-bit RGB565 number, e.g.
0xF800is red,0x07E0green and0x001Fblue. Handy to test the screen.
- hub.lcd.init() None[source]
Advanced: restart the screen’s drawing system (LVGL).
Not needed normally — it is already running when your program starts. Only use it if you shut LVGL down yourself.
- hub.lcd.loop() None[source]
Advanced: run one screen update step.
Call this repeatedly (about every 5 ms) if you drive LVGL from your own thread. Most programs use
lvgl.timer_handler()in their main loop instead.