2024-10-1101

This commit is contained in:
hans-jurgen 2024-10-11 13:37:39 +02:00
parent 578f6d5756
commit de78d2c23f

View File

@ -1,9 +1,5 @@
#include <Arduino.h> #include <Arduino.h>
/* Rui Santos & Sara Santos - Random Nerd Tutorials /* Rui Santos & Sara Santos - Random Nerd Tutorials
THIS EXAMPLE WAS TESTED WITH THE FOLLOWING HARDWARE: THIS EXAMPLE WAS TESTED WITH THE FOLLOWING HARDWARE:
1) ESP32-2432S028R 2.8 inch 240×320 also known as the Cheap Yellow Display (CYD): https://makeradvisor.com/tools/cyd-cheap-yellow-display-esp32-2432s028r/ 1) ESP32-2432S028R 2.8 inch 240×320 also known as the Cheap Yellow Display (CYD): https://makeradvisor.com/tools/cyd-cheap-yellow-display-esp32-2432s028r/
@ -62,8 +58,8 @@ void printTouchToSerial(int touchX, int touchY, int touchZ) {
// Print Touchscreen info about X, Y and Pressure (Z) on the TFT Display // Print Touchscreen info about X, Y and Pressure (Z) on the TFT Display
void printTouchToDisplay(int touchX, int touchY, int touchZ) { void printTouchToDisplay(int touchX, int touchY, int touchZ) {
// Clear TFT screen // Clear TFT screen
tft.fillScreen(TFT_WHITE); tft.fillScreen(TFT_GREEN);
tft.setTextColor(TFT_BLACK, TFT_WHITE); tft.setTextColor(TFT_RED, TFT_WHITE);
int centerX = SCREEN_WIDTH / 2; int centerX = SCREEN_WIDTH / 2;
int textY = 80; int textY = 80;
@ -105,6 +101,7 @@ void setup() {
tft.drawCentreString("Hello, world!", centerX, 30, FONT_SIZE); tft.drawCentreString("Hello, world!", centerX, 30, FONT_SIZE);
tft.drawCentreString("Touch screen to test", centerX, centerY, FONT_SIZE); tft.drawCentreString("Touch screen to test", centerX, centerY, FONT_SIZE);
delay(5000);
} }
void loop() { void loop() {