mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2024-10-05 20:47:50 -04:00
UI
This commit is contained in:
parent
ce652b4753
commit
e24ea3f282
Binary file not shown.
@ -2,10 +2,13 @@
|
|||||||
#include <GxGDEW042Z15/GxGDEW042Z15.h> // 4.2" b/w/r
|
#include <GxGDEW042Z15/GxGDEW042Z15.h> // 4.2" b/w/r
|
||||||
#include GxEPD_BitmapExamples
|
#include GxEPD_BitmapExamples
|
||||||
// FreeFonts from Adafruit_GFX
|
// FreeFonts from Adafruit_GFX
|
||||||
|
#include <Fonts/FreeMono9pt7b.h>
|
||||||
#include <Fonts/FreeMonoBold9pt7b.h>
|
#include <Fonts/FreeMonoBold9pt7b.h>
|
||||||
#include <Fonts/FreeMonoBold12pt7b.h>
|
#include <Fonts/FreeMonoBold12pt7b.h>
|
||||||
#include <Fonts/FreeMonoBold18pt7b.h>
|
#include <Fonts/FreeMonoBold18pt7b.h>
|
||||||
#include <Fonts/FreeMonoBold24pt7b.h>
|
#include <Fonts/FreeMonoBold24pt7b.h>
|
||||||
|
#include <Fonts/Picopixel.h>
|
||||||
|
#include <Fonts/TomThumb.h>
|
||||||
#include <GxIO/GxIO_SPI/GxIO_SPI.h>
|
#include <GxIO/GxIO_SPI/GxIO_SPI.h>
|
||||||
#include <GxIO/GxIO.h>
|
#include <GxIO/GxIO.h>
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
|
@ -12,12 +12,31 @@ void setup() {
|
|||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
Serial.println("Running setup ...");
|
Serial.println("Running setup ...");
|
||||||
|
|
||||||
|
// Initialize ePaper display
|
||||||
display.init(115200);
|
display.init(115200);
|
||||||
display.fillScreen(GxEPD_WHITE);
|
display.fillScreen(GxEPD_WHITE);
|
||||||
display.setTextColor(GxEPD_BLACK);
|
display.setTextColor(GxEPD_BLACK);
|
||||||
display.setFont(&FreeMonoBold9pt7b);
|
display.setFont(&FreeMono9pt7b);
|
||||||
display.setCursor(10, 20);
|
display.setCursor(205, 10);
|
||||||
display.print("ESP32 Display Node");
|
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();
|
display.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user