I have a WaveShare ESP32-C6-LCD-1.47.
I have been trying for the last few days to figure out a way to
1. get the display to display in landscape (Arduino IDE 2.3.6, LVGL library, SquareLine Studio)
2. How do I change the backlight level ? Set_Backlight(10) Does not change anything
Anyone have any ideas?
WaveShare ESP32-C6-LCD-1.47
-
lbernstone
- Posts: 1131
- Joined: Mon Jul 22, 2019 3:20 pm
Re: WaveShare ESP32-C6-LCD-1.47
I don't know anything about your configuration or this hardware in particular. "Landscape mode" is generally just setting the screen rotation to 90° and treating the longer direction as your x-axis. You can adjust the backlight with analogWrite(BL_PIN) from 0-255.
-
lbernstone
- Posts: 1131
- Joined: Mon Jul 22, 2019 3:20 pm
Re: WaveShare ESP32-C6-LCD-1.47
LVGL is a graphics library. This would be a function of your panel driver. You have not told us what driver you are using. Post a link to the example code you are working from (or your code).
Re: WaveShare ESP32-C6-LCD-1.47
Sorry, very new to ESP32.
My display drive is : Display_ST7789
my code is very basic.
at this point just trying to get it to display landscape and set backlight level.
This is my entire sketch https://limewire.com/d/4VOQk#DnH2G0iLEM
My display drive is : Display_ST7789
my code is very basic.
at this point just trying to get it to display landscape and set backlight level.
This is my entire sketch https://limewire.com/d/4VOQk#DnH2G0iLEM
Code: Select all
#include "Display_ST7789.h"
#include "LVGL_Driver.h"
#include "ui.h"
void setup()
{
LCD_Init();
Lvgl_Init();
ui_init();
Set_Backlight(3);
}
void loop()
{
Timer_Loop();
delay(5);
}-
lbernstone
- Posts: 1131
- Joined: Mon Jul 22, 2019 3:20 pm
Re: WaveShare ESP32-C6-LCD-1.47
That driver is not very good. Play around with the macros in Display_ST7789.h (esp HORIZONTAL and VERTICAL) to see if they have it flexible enough to do what you want. Otherwise, you can switch to TFT_eSPI for the driver and the rest of the ui stuff should just work.
Re: WaveShare ESP32-C6-LCD-1.47
I tried playing around with Display_ST7789.h
I tried flipping the value for Vertical/Horizontal, and LCD_WIDTH/LCD_HEIGHT, but this just give a garbage output on the LCD display.
I downloaded and looked at the TFT_eSPI driver but there are way too many settings that need to be adjusted for my board. This is way above my pay grade. I also googled for example projects with this driver and my display but couldn't find anything.
I tried flipping the value for Vertical/Horizontal, and LCD_WIDTH/LCD_HEIGHT, but this just give a garbage output on the LCD display.
I downloaded and looked at the TFT_eSPI driver but there are way too many settings that need to be adjusted for my board. This is way above my pay grade. I also googled for example projects with this driver and my display but couldn't find anything.
Re: WaveShare ESP32-C6-LCD-1.47
Hello,
The ESP32C6 ST779 driver provided in the Waveshare examples has a bug regarding screen rotation.
To use this board in landscape, modify the Display_ST7789.cpp and Display_ST7789.h with the following:
Display_ST7789.h:
Move to the top of the file:
#define VERTICAL 1
#define HORIZONTAL 0
Add just bellow these lines:
#if VERTICAL
#define LCD_WIDTH 320 //LCD height
#define LCD_HEIGHT 172 //LCD width
#define Offset_X 0
#define Offset_Y 34
#else
#define LCD_WIDTH 172 //LCD width
#define LCD_HEIGHT 320 //LCD height
#define Offset_X 34
#define Offset_Y 0
#endif
And delete LCD_WIDTH, LCD_HEIGHT, Offset_X and Offset_Y prior definitions.
Display_ST7789.cpp:
In function LCD_SetCursor replace
"if (HORIZONTAL) "
with
"if (1)"
After that, if you are using EEZ STUDIO or Squareline, simply configure the width to 320 and height to 172 in Settings and Pages, and it should work as desired.
Please note also that this board, at least on my case, is overheating on the part of the screen just near the USB, causing a back malfunction in this part of the LCD. This probably is due to an overheating of the LDO when consumption is high. As a workaround, you can set the backlight to 30 or 40 instead of 100. This lowers the consumption and seems to lower the temperature in the zone.
BR
The ESP32C6 ST779 driver provided in the Waveshare examples has a bug regarding screen rotation.
To use this board in landscape, modify the Display_ST7789.cpp and Display_ST7789.h with the following:
Display_ST7789.h:
Move to the top of the file:
#define VERTICAL 1
#define HORIZONTAL 0
Add just bellow these lines:
#if VERTICAL
#define LCD_WIDTH 320 //LCD height
#define LCD_HEIGHT 172 //LCD width
#define Offset_X 0
#define Offset_Y 34
#else
#define LCD_WIDTH 172 //LCD width
#define LCD_HEIGHT 320 //LCD height
#define Offset_X 34
#define Offset_Y 0
#endif
And delete LCD_WIDTH, LCD_HEIGHT, Offset_X and Offset_Y prior definitions.
Display_ST7789.cpp:
In function LCD_SetCursor replace
"if (HORIZONTAL) "
with
"if (1)"
After that, if you are using EEZ STUDIO or Squareline, simply configure the width to 320 and height to 172 in Settings and Pages, and it should work as desired.
Please note also that this board, at least on my case, is overheating on the part of the screen just near the USB, causing a back malfunction in this part of the LCD. This probably is due to an overheating of the LDO when consumption is high. As a workaround, you can set the backlight to 30 or 40 instead of 100. This lowers the consumption and seems to lower the temperature in the zone.
BR
Re: WaveShare ESP32-C6-LCD-1.47
Hi.
I have a problem with this device, black screen, can you provide your sketch for testing ?
I have a problem with this device, black screen, can you provide your sketch for testing ?
Who is online
Users browsing this forum: YisouSpider and 3 guests