2.9" Grayscale eInk / ePaper Display FeatherWing - 4 Level Grayscale

2.9" grayscale eInk / ePaper display with 296x128 pixels.   MicroSD socket included.   SPI communication.   Three custom buttons (A = D11, B = D12, C = D13) and a reset button are mounted on the display.  

Adafruit PN 4777

Adafruit tutorial

Adafruit 2.9" eInk Display Breakouts and FeatherWings tutorial

Firmware

In the Arduinio IDE, install the library 'Adafruit_EPD'.   Display update time is only one second (other displays typically required 15 seconds).   Each pixel can be white, light gray, dark gray or black.  

Adafruit_EPD library

Demo of Text Modes


/*
   
  Adafruit Feather M4 Express SAMD51 + ThinkInk 290 Grayscale 4 T5 Display


  AF_FeatherWing_Grayscale_eInk_ePaper_4777.ino
  
*/

/////////////////////////////////////////////////////////////////////////
// M4 Express built-in hardware

const uint8_t pinBuiltInLED = 13;  

const byte pinLiPoly = A6;

/////////////////////////////////////////////////////////////////////////
// ThinkInk 290 Grayscale4 T5 Display
//
// Adafruit PN 4777
// Adafruit 2.9" Grayscale eInk / ePaper Display FeatherWing - 4 Level Grayscale
// Adafruit tutorial: https://learn.adafruit.com/adafruit-eink-display-breakouts?view=all#grayscale-29-overview
// 2.9" grayscale display with 296x128 pixels
// MicroSD socket

#include "Adafruit_ThinkInk.h"

// Below configured for M0/M4
#define EPD_DC      10 // can be any pin, but required!
#define EPD_CS      9  // can be any pin, but required!
#define EPD_BUSY    -1  // can set to -1 to not use a pin (will wait a fixed delay)
#define SRAM_CS     6  // can set to -1 to not use a pin (uses a lot of RAM!)
#define EPD_RESET   -1  // can set to -1 and share with chip Reset (can't deep sleep)

// 2.9" Grayscale Featherwing or Breakout:
ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

#define COLOR1 EPD_BLACK
#define COLOR2 EPD_LIGHT
#define COLOR3 EPD_DARK

// Each pixel can be white, light gray, dark gray or black.
// Update time is only about 1 second (other displays take 15 sec). 

/////////////////////////////////////////////////////////////////////////


void setup() {

  // ThinkInk 290 Grayscale4 T5 Display
  // Adafruit EPD full update test in mono & grayscale
  // 296x128 pixels
  // See also:  Adafruit Graphics Primatives:  https://learn.adafruit.com/adafruit-gfx-graphics-library/graphics-primitives
  //            Adafruit GFX Graphics Library: https://learn.adafruit.com/adafruit-gfx-graphics-library?view=all
  

  display.begin(THINKINK_GRAYSCALE4); // grayscale mode
  //display.clearBuffer();
  //display.display();
  //delay(5000);


  // From Adafruit.EPD.h
  //  .begin()
  //  .drawPixel()
  //  .clearBuffer()
  //  .clearDisplay()
  //  .setBlackBuffer()
  //  .setColorBuffer
  //  .display()

  // From Adafruit_GFX
  //  .setTextSize()  1 is default 6x8, 2 is 12x16, 3 is 18x24, etc
  //  .setCursor(x, y)    coordinates in pixels
  

} // setup()


void loop() {

  // With .setTextSize(1), you get 18 rows of 48 characters/line
  // Characters are 6 px wide x 6 px tall  (VERY SMALL)
  // With spacing between rows and frame, start text at:
  //  (1,6), (1,8), (1,15), (1,22), (1,29), (1,36), (1,43), (1,50), (1,57), (1,57), (1,64), (1,71), (1,78), (1,85), (1,92), (1,99), (1,106), (1,113), (1,120)
  display.clearBuffer();
  display.setTextSize(1);
  display.setTextColor(EPD_BLACK);  // EPD_BLACK, EPD_DARK, EPD_LIGHT

  display.setCursor(1,8); 
  display.print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);
  
  display.setCursor(1,22); 
  display.print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);

  display.setCursor(1,36); 
  display.print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);

  display.setCursor(1,50); 
  //     .print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);
  display.print("          18 rows x 48 characters/row");  // .setTextSize(1);
  
  display.setCursor(1,64); 
  display.print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);
  
  display.setCursor(1,78); 
  //     .print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);
  display.print("Write on every other line to improve readability");  // .setTextSize(1);
  
  display.setCursor(1,92); 
  display.print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);
  
  display.setCursor(1,106); 
  display.print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);
    
  display.setCursor(1,120); 
  display.print("0123456789012345678901234567890123456789012345678");  // .setTextSize(1);
    
  display.display();
  delay(10000);


  // With .setTextSize(2), you get 7 rows of 23 characters/line
  // Characters are 12 px wide x 14 px tall
  // With spacing between rows and frame, start text at:
  //  (4,6), (4,23), (4,40), (4,56), (4,74), (4,91), (4,108)
  display.clearBuffer();
  display.setTextSize(2);
  display.setTextColor(EPD_BLACK);  // EPD_BLACK, EPD_DARK, EPD_LIGHT
  // (6,0),(6,14),(6,28),(6,42),(6,56),(6,70),(6,84),(6,96)
  display.setCursor(4,6);  // top left
  //     .print("012345678901234567890123");  // .setTextSize(2);
  display.print("012345678901234567890123");  // .setTextSize(2);

  display.setCursor(4,23); 
  //     .print("012345678901234567890123");  // .setTextSize(2);
  display.print("  23 characters wide");  // .setTextSize(2);

  display.setCursor(4,40); 
  //     .print("012345678901234567890123");  // .setTextSize(2);
  display.print("  7 rows with spacing");  // .setTextSize(2);

  display.setCursor(4,57);  
  //     .print("012345678901234567890123");  // .setTextSize(2);
  display.print("       EPD_BLACK");  // .setTextSize(2);

  display.setCursor(4,74);  
  display.setTextColor(EPD_DARK);  // EPD_BLACK, EPD_DARK, EPD_LIGHT
  //     .print("012345678901234567890123");  // .setTextSize(2);
  display.print("       EPD_DARK");  // .setTextSize(2);

  display.setCursor(4,91);  
  display.setTextColor(EPD_LIGHT);  // EPD_BLACK, EPD_DARK, EPD_LIGHT
  //     .print("012345678901234567890123");  // .setTextSize(2);
  display.print("       EPD_LIGHT");  // .setTextSize(2);

  display.setCursor(4,108);  
  display.setTextColor(EPD_BLACK);  // EPD_BLACK, EPD_DARK, EPD_LIGHT
  //     .print("012345678901234567890123");  // .setTextSize(2);
  display.print("012345678901234567890123");  // .setTextSize(2);
  
  display.display();
  delay(10000);

  // With .setTextSize(3), you get five rows of 15 characters/line
  // Characters are 20 px tall
  // With spacing between rows and frame, start text at:
  //    (5,6), (6,30), (6,54), (6,78), 6,102)
  display.clearBuffer();
  display.setTextSize(3);
  display.setTextColor(EPD_BLACK);  // EPD_BLACK, EPD_DARK, EPD_LIGHT
  
  display.setCursor(6,6);  // top left
  //     .print("0123456789012345");  // .setTextSize(3);
  display.print("0123456789012345");  // .setTextSize(3);

  display.setCursor(6,30); 
  //     .print("0123456789012345");  // .setTextSize(3);
  display.print(" 14 chars wide");  // .setTextSize(3);

  display.setCursor(6,54); 
  //     .print("0123456789012345");  // .setTextSize(3);
  display.print("chars 20 px tall");  // .setTextSize(3);

  display.setCursor(6,78); 
  //     .print("0123456789012345");  // .setTextSize(3);
  display.print("  5 rows tall ");  // .setTextSize(3);

  display.setCursor(6,102); 
  display.print("0123456789012345");  // .setTextSize(3);

  display.display();


  delay(10000);
  // Mechatronic Solutions LLC splash screen...
  display.clearBuffer();
  display.setTextSize(3);
  display.setTextColor(EPD_BLACK);  // EPD_BLACK, EPD_DARK, EPD_LIGHT
  
  display.setCursor(6,6);  // top left
  //     .print("0123456789001234");  // .setTextSize(3);

  display.setCursor(6,30); 
  //     .print("0123456789001234");  // .setTextSize(3);
  display.print("  Mechatronic");  // .setTextSize(3);

  display.setCursor(6,54); 
  //     .print("0123456789001234");  // .setTextSize(3);

  display.setCursor(6,78); 
  //     .print("0123456789001234");  // .setTextSize(3);
  display.print(" Solutions LLC");  // .setTextSize(3);

  display.setCursor(6,102); 

  display.display();
  delay(5000);


} // loop()

 


Do you need help developing or customizing a IoT product for your needs?   Send me an email requesting a free one hour phone / web share consultation.  

 

The information presented on this website is for the author's use only.   Use of this information by anyone other than the author is offered as guidelines and non-professional advice only.   No liability is assumed by the author or this web site.