This commit is contained in:
Alexander 2024-02-18 22:32:47 -05:00
parent ce652b4753
commit e24ea3f282
3 changed files with 25 additions and 3 deletions

View File

@ -2,10 +2,13 @@
#include <GxGDEW042Z15/GxGDEW042Z15.h> // 4.2" b/w/r
#include GxEPD_BitmapExamples
// FreeFonts from Adafruit_GFX
#include <Fonts/FreeMono9pt7b.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include <Fonts/FreeMonoBold12pt7b.h>
#include <Fonts/FreeMonoBold18pt7b.h>
#include <Fonts/FreeMonoBold24pt7b.h>
#include <Fonts/Picopixel.h>
#include <Fonts/TomThumb.h>
#include <GxIO/GxIO_SPI/GxIO_SPI.h>
#include <GxIO/GxIO.h>
#include <SPI.h>

View File

@ -12,12 +12,31 @@ void setup() {
Serial.begin(115200);
Serial.println("Running setup ...");
// Initialize ePaper display
display.init(115200);
display.fillScreen(GxEPD_WHITE);
display.setTextColor(GxEPD_BLACK);
display.setFont(&FreeMonoBold9pt7b);
display.setCursor(10, 20);
display.print("ESP32 Display Node");
display.setFont(&FreeMono9pt7b);
display.setCursor(205, 10);
display.print("ESP32_DisplayNode");
display.setCursor(5, 5);
display.setFont(&TomThumb);
display.print("10.100.50.105");
// Add UI elements
// Draw axis: (x1,y1) @ 5, 100 and width-2*margin_x height-2*margin_y 140
display.drawRect(5, 155, display.width()-10, display.height()-160, GxEPD_RED);
display.setFont(&TomThumb);
for (int i = 0; i < display.width()-10; i+=50) {
display.setCursor(i, display.height());
display.print(i);
}
// Calibration lines
/*display.drawLine(0, 100, display.width(), 100, GxEPD_BLACK);
display.drawLine(0, 200, display.width(), 200, GxEPD_BLACK);
display.drawLine(200, 0, 200, display.height(), GxEPD_BLACK);*/
display.update();
}