본문 바로가기
IT/Platform

[아두이노] ESP32-2423: #3 PlatformIO & Touch

by 블랙오닉스 2024. 11. 24.

2024.11.24

LVGL까지는 성공해서 화면이 잘 나왔지만 터치가 인식되지 않는다.

판매자 페이지 링크와 모델명이 조금 달라서 ESP32-2432S028로 검색.

다운받은 모델은 S024

https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display

 

GitHub - witnessmenow/ESP32-Cheap-Yellow-Display: Building a community around a cheap ESP32 Display with a touch screen

Building a community around a cheap ESP32 Display with a touch screen - witnessmenow/ESP32-Cheap-Yellow-Display

github.com

 

S028 회로도

터치와 LCM의 SPI가 분리되어 있다.

터치
LCM

예제 코드의 내용. 회로도와 일치한다.

#define XPT2046_IRQ 36
#define XPT2046_MOSI 32
#define XPT2046_MISO 39
#define XPT2046_CLK 25
#define XPT2046_CS 33
SPIClass mySpi = SPIClass(VSPI);
XPT2046_Touchscreen ts(XPT2046_CS, XPT2046_IRQ);

이 예제로 빌드 도전 -> 빌드 성공

 

Dependency Graph
|-- TFT_eSPI @ 2.4.61+sha.84238dd
|-- lvgl @ 8.3.3+sha.5545ffc
|-- XPT2046_Touchscreen @ 1.4.0+sha.f956c5d
|-- SPI @ 2.0.0

 

하지만 터치는 안된다. 화면도 깨지고

LVGL version V8.3.3
[    19][E][esp32-hal-cpu.c:110] addApbChangeCallback(): duplicate func=0x400fd7e8 arg=0x3ffbddac
[    28][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
Setup done

User_Setup.h 다시 확인. 아래처럼 고치고 터치 성공

#define SPI_FREQUENCY  55000000
#define USE_HSPI_PORT

 

하지만 화면이 이상하다. 색이 깨진다.


LVGL 예제 문서를 보니 필요버전이 나와 있다.

Arduino IDE v1.8.19 on Windows 11
ESP32 Arduino Core v2.0.14
TFT_eSPI v2.5.34, already configured and tested against the CYD
XPT2046_touchscreen v1.4.0, already configured and tested against the CYD
LVGL version v8.3.11

버전 바꾸면 라이브러리 설치하다 에러

기존버전으로 다시 빌드 -> lv_demo_widgets가 없다고 에러

.pio/libdeps/esp32dev/lvgl/lv_conf.h:752: warning: "LV_USE_DEMO_WIDGETS" redefined

lv_conf.h를 직접 편집해야 되는듯


화면이 깨져서 버전 바꿨다 다시 돌아 왔는데 터치가 안된다. ㅠㅠ