Min. exercises to display on 2.13" 250x122 3-color E-paper with ESP32-S3, using GxEPD2 and Adafruit_EPD

In my former posts, show how to install library and run example to display on 2.13" 250x122 3-color Epaper with ESP32-S3, using GxEPD2 and Adafruit_EPD. Here is my minimum exercise using GxEPD2 and Adafruit_EPD libraries respectively.



ESP32_GxEPD2_SSD1680.ino, using ZinggJM/GxEPD2 library.
/*
 *Minimum exercise using ZinggJM/GxEPD2
 *Run on ESP32 Dev Module
 *display on 2.13" 250x122 3-color E-paper (SSD1680)
 *
 * ref: GxEPD2_MinimumExample.ino
 * https://github.com/ZinggJM/GxEPD2/blob/master/examples/GxEPD2_MinimumExample/GxEPD2_MinimumExample.ino
 * 
 */

#include <GxEPD2_3C.h> // including both doesn't use more code or ram
#include <Fonts/FreeMonoBold9pt7b.h>

#define EPD_CS     5
#define EPD_DC     0
#define SRAM_CS    -1
#define EPD_RESET  2
#define EPD_BUSY   15

GxEPD2_3C<GxEPD2_213_Z98c, GxEPD2_213_Z98c::HEIGHT> display(
  GxEPD2_213_Z98c(EPD_CS, EPD_DC, EPD_RESET, EPD_BUSY));


void setup()
{
  display.init();
  display.setRotation(3);
  display.setFont(&FreeMonoBold9pt7b);

  display.firstPage();
  do
  {
    display.fillScreen(GxEPD_WHITE);

    display.drawRect(0, 0, display.width(), display.height(), GxEPD_RED);

    display.setTextColor(GxEPD_BLACK);
    display.setCursor(5, 20);
    display.print("coXXect");

    display.setTextColor(GxEPD_BLACK);
    display.setCursor(5, 40);
    display.print("coxxect.blogspot.com");

    display.setTextColor(GxEPD_RED);
    display.setCursor(5, 80);
    display.print("Using GxEPD2");

  }
  while (display.nextPage());
}

void loop() {};


ESP32_EPD_SS1680.ino, using Adafruit_EPD library.
/*
 *Minimum exercise using Adafruit_EPD
 *Run on ESP32 Dev Module
 *display on 2.13" 250x122 3-color E-paper (SSD1680)
 *
 * In my test (base on one and only on sample),
 * the display area shift vertically.
 * So I have to adjust 250x122 to 250x114.
 */

#include "Adafruit_ThinkInk.h"

#define EPD_CS     5
#define EPD_DC     0
#define SRAM_CS    -1
#define EPD_RESET  2
#define EPD_BUSY   15

//Adafruit_SSD1680 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
Adafruit_SSD1680 display(250, 114, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

void setup() {
  delay(500);
  display.begin(THINKINK_TRICOLOR);
  display.clearBuffer();

  display.drawRect(0, 0, display.width(), display.height(), EPD_BLACK);
  
  display.setTextSize(2);
  display.setCursor(5, 20);
  display.setTextColor(EPD_RED);
  display.print("coXXect");

  display.setTextSize(1);
  display.setCursor(5, 40);
  display.setTextColor(EPD_RED);
  display.print("https://coxxect.blogspot.com/");

  display.setTextSize(2);
  display.setCursor(5, 80);
  display.setTextColor(EPD_BLACK);
  display.print("Using Adafruit_EPD");
  
  display.display();

}

void loop() {
}



Comments

Popular posts from this blog

MicroPython/ESP32-C3 + 1.8" 128x160 TFT ST7735 SPI, using boochow/MicroPython-ST7735 library.

CameraWebServe: ESP32-S3 (arduino-esp32) + OV5640 camera module