#include <GxEPD.h>
#include <GxDEPG0290BS/GxDEPG0290BS.h> // 2.9" b/w Waveshare variant, TTGO T5 V2.4.1 2.9"
#include <GxIO/GxIO_SPI/GxIO_SPI.h>
#include <GxIO/GxIO.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include <Fonts/FreeMonoBold12pt7b.h>
// Create an instance of the display
GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9); // for Arduino R3
GxEPD_Class display(io, /*RST=*/ 9, /*BUSY=*/ 7);
const uint8_t triangleBitmap[] PROGMEM = {
0x00, 0x18, 0x3C, 0x7E, 0xFF, 0x00, 0x00, 0x00, // Simple triangle (8x8)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const uint8_t squareBitmap[] PROGMEM = {
0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xFF, // Simple square (8x8)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
void setup() {
Serial.begin(115200);
Serial.println("setup");
display.init(115200); // enable diagnostic output on Serial
Serial.println("setup done");
}
void loop() {
showTriangle();
delay(2000);
showSquare();
delay(2000);
// showText("Arvind PATIL");
showText(" AN EYE FOR AN EYE WILL MAKE THE WHOLE WORLD BLIND");
delay(5000);
display.powerDown();
delay(10000);
}
void showTriangle() {
display.fillScreen(GxEPD_WHITE);
display.drawBitmap(64, 64, triangleBitmap, 8, 8, GxEPD_BLACK);
display.update();
}
void showSquare() {
display.fillScreen(GxEPD_WHITE);
display.drawBitmap(64, 64, squareBitmap, 8, 8, GxEPD_BLACK);
display.update();
}
void showText(const char* text) {
display.fillScreen(GxEPD_WHITE);
display.setFont(&FreeMonoBold12pt7b);
display.setTextColor(GxEPD_BLACK);
display.setCursor(20, 50);
display.print(text);
display.update();
}