Please help!
I purchased a 3-inch e-Paper Display from Waveshare, which appeared to suit my project well. The exemplary little code to show an image was easy to set up and to demonstrate functionality:
#include <SPI.h> #include "epd3in0g.h" #include "imagedata.h" Epd epd; void setup() { // put your setup code here, to run once: Serial.begin(115200); Serial.print("e-Paper init "); if (epd.Init() != 0) { Serial.print("e-Paper init failed"); return; } Serial.print("White \r\n"); epd.Clear(white); delay(2000); epd.Init(); Serial.print("Image \r\n"); epd.Display(IMAGE_DATA); delay(2000); epd.Init(); Serial.print("Small Image \r\n"); epd.Display_part(IMAGE_DATA, 0 ,0, 168, 400); delay(2000); epd.Init(); Serial.print("Clear...\r\n"); epd.Clear(white); delay(2000); Serial.print("Goto Sleep...\r\n"); epd.Sleep(); } void loop() { } I will not just have images displayed, I aim for strings with text and numbers and those partial refreshed. Wild guesses if a
epd.Display_Text('''Hello World'''); might work is pointless. Thus, the existence and usage of possible commands for the epd. appears to me not well documented (or I was unable to find something even after a thoroughly search).
I had a look at other examples using GxEPD libraries and it seemed as a good starting point for me.
Within the GxEPD2 Library it seems a class for 3-inch EPD is missing as it is nowhere declared (I assume there should be something like a GxEPD_300 to set display dimensions etc.).
So, I reckon I need to wrap up something to meet the specs of the 400x168 pixel display but I don't know where to start.
I tried around with the GxEPD_MinimumExample.ino, like
- replacing the display specific lib with the epd3in0g.h from the example
- adjusted the right pins according to the Waveshare Wiki
// GxEPD_MinimumExample by Jean-Marc Zingg #include <GxEPD.h> // select the display class to use, only one, copy from GxEPD_Example //#include <GxGDEH0154D67/GxGDEH0154D67.h> // 1.54" b/w -> from org. example. #include "epd3in0g.h" //my 3-inch display #include <GxIO/GxIO_SPI/GxIO_SPI.h> #include <GxIO/GxIO.h> // constructor for AVR Arduino, copy from GxEPD_Example else GxIO_Class io(SPI, /*CS=*/ 10, /*DC=*/ 9, /*RST=*/ 8); // arbitrary selection of 8, 9 selected for default of GxEPD_Class GxEPD_Class display(io, /*RST=*/ 8, /*BUSY=*/ 7); // default selection of (9), 7 void setup() { display.init(); display.eraseDisplay(); // comment out next line to have no or minimal Adafruit_GFX code display.drawPaged(drawHelloWorld); // version for AVR using paged drawing, works also on other processors } void drawHelloWorld() { display.setTextColor(GxEPD_BLACK); display.print("Hello World!"); } void loop() {}; During the verification prior the upload I get errors pointing back to the libs:
error: 'GxEPD_Class' does not name a type; did you mean 'GxIO_Class'?* I assume this is because the call to initiate the display is not working.
Thank you for any advice!