Step by Step install of LVGL to esp idf in vsCode

Thanks for sticking with this but again the above will not work on the waveshare, there is no RGB led or strip on this device.

The gfx library I tried for the hello world is not compatible either.

There is also no driver / library for the Touch that works, cst816D, which is why I will have to use LVGL only for this device.

But there is the catch, they don’t supply any examples to get you started for Lvgl and there seems to be nothing online either

Back to square 1 - no simple LVGL example for a line of text and a touch button.

Edit since trying that above example, Platformio has disappeard from Code - tried complete uninstall, deleted all Platformio directories, reinstall but nothing it now won’t show at all ?

Edit…Edit - Turns out I was in a virtual work space which disables Platformio :woozy_face:

I dont mean test RGB leds, this simply remove and use empty base.
But C6 is specific, read Add TFT_eSPI_ESP32_C6.c and TFT_eSPI_ESP32_C6.h by Cincinnatu · Pull Request #3399 · Bodmer/TFT_eSPI · GitHub

I have been at it all day today, trying all the project examples on Platformio.
The only one that did load was the simple Arduino Blink - but that did nothing (could not find any info for the led - guess there isn’t one…)

Even trying to write to the serial port to display something in a loop doesn’t work.

I did have the above TFT_eSPI working in Arduino IDE but only to print to the screen, Touch is needs LVGL but that isn’t compatible with Arduino hence I ended up here…

OK i get time and unzip demo from waveshare. In folder is all you require
ESP32-C6-LCD-1.9-Demo-V2\Arduino\examples\08_LVGL_Test\FT3168.cpp is for example part of code used to read touch CST816 seems be compatibe variant FT3168…

Then steps to run app demo from this folder is :slight_smile:

  1. unzip ESP32-C6-LCD-1.9-Demo-V2\Arduino\examples\08_LVGL_Test\ into your project src folder
  2. rename 08_LVGL_Test.ino to main.cpp
  3. to ini file set used right library save it and wait for download
  4. after this config lvgl conf in downloaded lib. (can copy to right place from zip too)

build

And FYI if you open and read lcd_bsp.c yu see , that this demo uses esp_lcd_panel class (native) and no ArduinoGFX.

Thanks, Ill have a go with that later…see if that one will work.

What am I doing wrong here, how do I get the worlds most simple test to work ??

#include <Arduino.h>

void setup() {
Serial.begin(115200); // Initialize serial communication
Serial.println(“Serial communication started”); //Print a message to confirm it’s running
}

void loop() {
Serial.print("Current time: ");
Serial.println(millis()); //Print the current time
delay(1000);
}

[env:esp32-c6-devkitc-1]

platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip
;https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
framework = arduino
board = esp32-c6-devkitc-1
monitor_speed = 115200

Ok, 2 days later, found someone else with the same problem, needed this:

build_flags =
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1

OK so now on to the LVGL test…

What do you mean here…
4: after this config lvgl conf in downloaded lib. (can copy to right place from zip too)

The file tells me this but is makes no sense:
/*

  • Copy this file as lv_conf.h
    1. simply next to lvgl folder
    1. or to any other place and
    • define LV_CONF_INCLUDE_SIMPLE;
    • add the path as an include path.
      */

I’m not sure where to put the config file and how to inclue it

I get alot of errors:
In file included from .pio/libdeps/esp32-c6-devkitc-1/lvgl/src/lv_init.h:16,
from .pio/libdeps/esp32-c6-devkitc-1/lvgl/lvgl.h:21,
from src/lcd_bsp.h:14,
from src/lcd_bsp.c:1:
.pio/libdeps/esp32-c6-devkitc-1/lvgl/src/lv_conf_internal.h:65:17: note: ‘#pragma message: Possible failure to include lv_conf.h, please read the comment in this file if you get errors’
65 | #pragma message(“Possible failure to include lv_conf.h, please read the comment in this file if you get errors”)
| ^~~~~~~
src/lcd_bsp.h:25:35: error: unknown type name ‘lv_disp_drv_t’; did you mean ‘lv_fs_drv_t’?
25 | static void example_lvgl_flush_cb(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map);

If your project is depend on for example LVGL 8.4.0 , you in ini must place this version. PIO after save ini download it into project folder .pio/libdesp/envname/lvgl

lib_deps = 
	lvgl/lvgl@8.4.0

after download copy conf template or from waveshare zip to same folder

OK, done that but how do I tell it to include?
46 | #pragma message(“Possible failure to include lv_conf.h, please read the comment in this file if you get errors”)

libdeps is included automatic.
EDIT and same folder i mean .pio/libdesp/envname

I think its all a bit of a mess, the waveshare examples are not compatible with v9 or 8.4, assume they have to be the exact same version…

In file included from src/lcd_bsp.h:15,
from src/lcd_bsp.c:1:
src/lv_demos.h:35:10: fatal error: widgets/lv_demo_widgets.h: No such file or directory
35 | #include “widgets/lv_demo_widgets.h”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

These are the same problems I get with Arduino IDE, the waveshare examples just do not work with Arduino unless you are able to tell me different ?

I never build demos and normal default is autoinclude only lib to project.
Then two ways is A. copy demos B. edit lib json … read docu lvgl how use demos and examples…

Unfortunately this is what I am struggling with.
I have read and followed all the instructions but since 2 weeks I am still unable to find a single LVGL example that works with Arduino.

The demo just does not work, even putting the demo/eamples into the correct folder.
Tried the example within the LVGL folder and followed the instructions only to get this for the first of many many errors…

src/main.cpp: In function ‘void setup()’:
src/main.cpp:96:9: error: ‘class TFT_eSPI’ has no member named ‘setTouch’

I dont see what you copy, but main renamed ino file is this = no espi…

#include "lcd_bsp.h"
#include "lcd_bl_pwm_bsp.h"
void setup()
{
  Serial.begin(115200);
  lcd_lvgl_Init();
  setUpdutySubdivide(LCD_GPIO_MODE,LCD_GPIO_MODE_ON);
}
void loop()
{
  //delay(1000);
  //setUpdutySubdivide(LCD_PWM_MODE,LCD_PWM_MODE_255);
  //delay(1000);
  //setUpdutySubdivide(LCD_PWM_MODE,LCD_PWM_MODE_200);
  //delay(1000);
  //setUpdutySubdivide(LCD_PWM_MODE,LCD_PWM_MODE_150);
  //delay(1000);
  //setUpdutySubdivide(LCD_PWM_MODE,LCD_PWM_MODE_100);
  //delay(1000);
  //setUpdutySubdivide(LCD_PWM_MODE,LCD_PWM_MODE_50);
  //delay(1000);
  //setUpdutySubdivide(LCD_PWM_MODE,LCD_PWM_MODE_0);
}

not clean why loop is empty but this is waveshare demo not real code…

That was another example from lvgl for Arduino that doesn’t work…

It included TFT_espi for the display.
I used the modded one that I have working perfectly in Arduino ide by itself but again, the lvgl example fails to work.

I am pretty stumped to be honest.