From 35b6a299dac02cee24c87e435cbb9a67dd5bfa46 Mon Sep 17 00:00:00 2001 From: Alexander Bobkov Date: Fri, 25 Apr 2025 00:41:09 -0400 Subject: [PATCH] ESP32-C3 ePaper --- ESP32-C3_ePaper/src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ESP32-C3_ePaper/src/main.cpp b/ESP32-C3_ePaper/src/main.cpp index 7dc3fd65b..9c113c1cc 100644 --- a/ESP32-C3_ePaper/src/main.cpp +++ b/ESP32-C3_ePaper/src/main.cpp @@ -63,11 +63,11 @@ void setup() { display.setFont(&FreeSans9pt7b); display.print("PreeSerif 9pt7b"); - //display.setCursor(10, 100); - display.setFont(&FreeSerif18pt7b); - display.getTextBounds("INFO DASHBOARD", 10, 100, &tbx, &tby, &tbw, &tbh); - display.setCursor((display.width() - tbw) / 2, 100); - display.print("INFO DASHBOARD"); +// Display text nicely centered on the display + display.setFont(&FreeSerif18pt7b); // Specify the font family & size + display.getTextBounds("INFO DASHBOARD", 10, 100, &tbx, &tby, &tbw, &tbh); // Request width of text to be displayed + display.setCursor((display.width() - tbw) / 2, 100); // Calculate x-coordinate value + display.print("INFO DASHBOARD"); // Print the text //display.update(); //display.drawBitmap(200, 200, gridicons_bug, 24, 24, GxEPD_BLACK);