Description
I have created charts for my display. My problem is that all the ticks in the charts have vertical pixelation.
What MCU/Processor/Board and compiler are you using?
ESP32-S3
What LVGL version are you using?
8.3.11
What do you want to achieve?
Remove the pixelation
What have you tried so far?
Change size of the chart, change ticks width, change buffer size
Code to reproduce
#include <WiFi.h>
#include <Wire.h>
#include <SPI.h>
#include <HTTPClient.h>
#include <WiFiClientSecure.h>
#include <ArduinoJson.h>
#include <string.h>
#include <lvgl.h>
#include "ui.h"
#include "gfx_conf.h"
static lv_disp_draw_buf_t draw_buf;
static lv_color_t disp_draw_buf1[screenWidth * screenHeight / 8];
static lv_color_t disp_draw_buf2[screenWidth * screenHeight / 8];
static lv_disp_drv_t disp_drv;
void setup() {
Serial.begin(9600);
Serial.println("LVGL Widgets Demo");
delay(1000);
//Display Prepare
tft.begin();
tft.fillScreen(TFT_BLACK);
tft.setTextSize(2);
delay(200);
lv_init();
delay(100);
lv_disp_draw_buf_init(&draw_buf, disp_draw_buf1, disp_draw_buf2, screenWidth * screenHeight / 8);
/* Initialize the display */
lv_disp_drv_init(&disp_drv);
/* Change the following line to your display resolution */
disp_drv.hor_res = screenWidth;
disp_drv.ver_res = screenHeight;
disp_drv.flush_cb = my_disp_flush;
disp_drv.full_refresh = 1;
disp_drv.draw_buf = &draw_buf;
lv_disp_drv_register(&disp_drv);
/* Initialize the (dummy) input device driver */
static lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = my_touchpad_read;
lv_indev_drv_register(&indev_drv);
tft.fillScreen(TFT_BLACK);
ui_init();
Serial.println("Setup done");
}
void loop() {
lv_timer_handler();
delay(5);
}
/* Display flushing */
void my_disp_flush(lv_disp_drv_t* disp, const lv_area_t* area, lv_color_t* color_p) {
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
tft.pushImageDMA(area->x1, area->y1, w, h, (lgfx::rgb565_t*)&color_p->full);
lv_disp_flush_ready(disp);
}
void my_touchpad_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data) {
uint16_t touchX, touchY;
bool touched = tft.getTouch(&touchX, &touchY);
if (!touched) {
data->state = LV_INDEV_STATE_REL;
} else {
data->state = LV_INDEV_STATE_PR;
/*Set the coordinates*/
data->point.x = touchX;
data->point.y = touchY;
Serial.print("Data x ");
Serial.println(touchX);
Serial.print("Data y ");
Serial.println(touchY);
}
}
It is based on the code used in this tutorial:
The config for the screen is: CrowPanel-ESP32-Display-Course-File/CrowPanel_ESP32_Tutorial/Code/Lesson 6 Design UI with Squareline Studio/4.3-5-7inch/CrowPanel_ESP32_LVGL_Demo/gfx_conf.h at main · Elecrow-RD/CrowPanel-ESP32-Display-Course-File · GitHub