Hello,
I've been playing with an E-INK screen (or E-PAPER) recently, specifically this one:
Here the wiki:
https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT
I can run the examples from the Waveshare (official), GxEPD and GxEPD_AVR libraries, all work perfectly.
The problem is that when trying to do my tests, I just want to get text to the screen, I have half achieved but I can only write in a small part of the display, not displaying the rest of the text that goes beyond. I guess, from what I've read out there, that maybe it has something to do with the "display.setRotation (2);" instruction, but no idea. Please, can someone guide me? because I'm newbie programming, how can I write on the whole screen (or just where I want)?
Here my code for Arduino Mega:
// mapping suggestion from Waveshare SPI e-Paper to Wemos D1 mini
// BUSY -> D2, RST -> D4, DC -> D3, CS -> D8, CLK -> D5, DIN -> D7, GND -> GND, 3.3V -> 3.3V
#include <GxEPD.h>
#include <GxGDE0213B1/GxGDE0213B1.cpp> // 2.13" b/w
//Fonts
#include <Fonts/FreeMonoBold9pt7b.h>
#include <Fonts/FreeMonoBold12pt7b.h>
#include <Fonts/FreeMonoBold18pt7b.h>
#include <Fonts/FreeMonoBold24pt7b.h>
#include <GxIO/GxIO_SPI/GxIO_SPI.cpp>
#include <GxIO/GxIO.cpp>
GxIO_Class io(SPI, SS, 9, 8); // arbitrary selection of D3(=0), D4(=2), selected for default of GxEPD_Class //SPI, CS, DC, RST
GxEPD_Class;
GxEPD_Class display(io); // default selection of D4(=2), D2(=4) //RST=8, BUSY=7
void setup() {
// put your setup code here, to run once:
// setup the display
display.init();
//Display colours
display.fillScreen(GxEPD_BLACK);
display.setTextColor(GxEPD_WHITE);
// load a font - in the library
display.setFont(&FreeMonoBold9pt7b);
// let the strings begin
display.setCursor(0, 0);
display.setRotation(2);
display.println();
display.println("Testing");
display.println("Testing");
display.println("Testing");
display.update();
//delay (3000);
}
void loop() {
// put your main code here, to run repeatedly:
}
Only i can write inside of the black rectangle (attached picture).
Here the libraries:
Waveshare
GxEPD
GxEPD_AVR
Extra library necessary for GxEPD:
Adafruit-GFX-Library
For the code I have based on the one that appears in these links:
https://github.com/ZinggJM/GxEPD/issues/24
https://steve.fi/Hardware/d1-epaper/
Waiting your help.
Regards.
