Here is the code:
#include "Adafruit_EPD.h"
#define EPD_CS 10
#define EPD_DC 9
#define SRAM_CS 8
#define EPD_RESET 5 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY 3 // can set to -1 to not use a pin (will wait a fixed delay)
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
#define FLEXIBLE_213 true
#define COLOR1 EPD_BLACK
#define COLOR2 EPD_RED
void setup() {
Serial.begin(115200);
//while (!Serial) { delay(10); }
Serial.println("Adafruit EPD test");
display.begin();
#if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
// The flexible displays have different buffers and invert settings!
display.setBlackBuffer(1, false);
display.setColorBuffer(1, false);
#endif
// large block of text
display.clearBuffer();
testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", COLOR1);
display.display();
delay(5000);
display.clearBuffer();
for (int16_t i=0; i<display.width(); i+=4) {
display.drawLine(0, 0, i, display.height()-1, COLOR1);
}
for (int16_t i=0; i<display.height(); i+=4) {
display.drawLine(display.width()-1, 0, 0, i, COLOR2); // on grayscale this will be mid-gray
}
display.display();
}
void loop() {
//don't do anything!
}
void testdrawtext(char *text, uint16_t color) {
display.setCursor(0, 0);
display.setTextColor(color);
display.setTextWrap(true);
display.print(text);
}