# Adafruit 2.7" eInk Display Breakouts and Shields

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/111/668/medium800/raspberry_pi_4098-04.jpeg?1652292300)

Easy e-paper finally comes to microcontrollers with these breakouts and shields that are designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those new-fangled 'e-readers' like the Kindle or Nook. They have gigantic electronic paper 'static' displays - that means the image stays on the display even when power is completely disconnected. The image is also high contrast and very daylight readable. It really does look just like printed paper!

![](https://cdn-learn.adafruit.com/assets/assets/000/111/671/medium800/raspberry_pi_4229-05.jpeg?1652294715)

Adafruit has liked these displays for a long time, but they were never designed for makers to use. Finally, we decided to make our own!

## We have a couple of 2.7" EPD displays:

- The [264x176 Tri-Color Breakout](https://www.adafruit.com/product/4098) has black and red ink pixels and a white-ish background.
- The [264x176 Tri-Color Shield](https://www.adafruit.com/product/4229) has the same display as the breakout, but is in a convenient shield for factor for Metro and Arduino Uno boards.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/673/medium800/raspberry_pi_4229-04.jpeg?1652294841)

Using an Adafruit Arduino library, you can create a 'frame buffer' with what pixels you want to have activated and then write that out to the display. Most simple breakouts leave it at that. But if you do the math, 264 x 176 pixels x 2 colors = 11.5 KBytes. Which won't fit into many microcontroller memories. Heck, even if you do have 32KB of RAM or more, why waste 12KB?

**So we did you a favor and tossed a small SRAM chip on the back.** This chip shares the SPI port the eInk display uses, so you only need one extra pin. And, no more frame-buffering! **You can use the SRAM to set up whatever you want to display, then shuffle data from SRAM to eInk when you're ready. [The library Adafruit has does all the work for you](https://github.com/adafruit/Adafruit_EPD)**[, you can just interface with it as if it were an Adafruit\_GFX compatible display](https://github.com/adafruit/Adafruit_EPD).

![](https://cdn-learn.adafruit.com/assets/assets/000/111/672/medium800/raspberry_pi_4098-03.jpeg?1652294745)

For ultra-low power usages, the onboard 3.3V regulator has the Enable pin brought out so you can shut down the power to the SRAM, MicroSD and display.

There is even an added MicroSD socket on the breakouts and FeatherWings, so you can store images, text files, whatever you like to display. Everything is 3 or 5V logic safe, so you can use it with any and all common Maker microcontrollers.

![](https://cdn-learn.adafruit.com/assets/assets/000/119/992/medium800/raspberry_pi_4098-08.jpg?1680270999)

 **As of March 28, 2023** – we've updated this eInk breakout to **EK79686** chipset - previously we were using the **IL91874** chipset. We've also revised the PCB with an [**EYESPI connector**](https://www.adafruit.com/?q=eyespi&sort=BestMatch) to make cabling easier with an 18-pin FPC. We also used [**Adafruit Pinguin**](https://github.com/adafruit/Adafruit_Pinguin) to make a lovely silkscreen. The board is otherwise the same size, pinout, and functionality.

# Adafruit 2.7" eInk Display Breakouts and Shields

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/111/676/medium800/raspberry_pi_4098-04.jpeg?1652295141)

This e-Paper display uses SPI to receive image data. Since the display is SPI, it was easy to add two more SPI devices to share the bus - an SPI SRAM chip and SPI-driven SD card holder. There are quite a few pins and a variety of possible combinations for control depending on your needs

![](https://cdn-learn.adafruit.com/assets/assets/000/075/679/medium800/adafruit_products_4197.png?1557864475)

Info: 

## EYESPI

The 2.7" 264x176 Tri-Color eInk now comes with an EYESPI connector, which is an 18pin 0.5mm pitch connector that allows you to use a flex cable to connect your display to your microcontroller. For more details, visit the [EYESPI page](https://learn.adafruit.com/adafruit-2-13-eink-display-breakouts-and-featherwings/eyespi).

## Power Pins
![](https://cdn-learn.adafruit.com/assets/assets/000/057/632/medium800/adafruit_products_powerpins.jpg?1531705942)

- **3-5V / Vin** - this is the power pin, connect to 3-5VDC - it has reverse polarity protection but try to wire it right!
- **3.3V** out - this is the 3.3V output from the onboard regulator, you can 'borrow' about 100mA if you need to power some other 3.3V logic devices
- **GND** - this is the power and signal ground pin
- **ENA** ble - This pin is all the way on the right. It is connected to the enable pin on the onboard regulator that powers everything. If you want to _really_ have the lowest possible power draw, pull this pin low! Note that if you do so, you will cut power to the eInk display AND also the SPI RAM (thus erasing it) and the SD card (which means you'll have to re-initialize it when you re-power things.

## Data Control Pins
![](https://cdn-learn.adafruit.com/assets/assets/000/057/630/medium800/adafruit_products_datapins.jpg?1531705928)

- **SCK** - this is the SPI clock input pin, required for e-Ink, SRAM and SD card
- **MISO** - this is the SPI Microcontroller In Serial Out pin, its used for the SD card and SRAM. It isn't used for the e-Ink display which is write-only, however you'll likely be using the SRAM to buffer the display so connect this one too!
- **MOSI** - this is the SPI Microcontroller Out Serial In pin, it is used to send data from the microcontroller to the SD card, SRAM and e-Ink display
- **ECS** - this is the **E** -Ink **C** hip **S** elect, required for controlling the display
- **D/C** - this is the e-Ink **D** ata/ **C** ommand pin, required for controlling the display
- **SRCS** - this is the **S**** R **AM** C **hip** S**elect, required for communicating with the onboard RAM chip.
- **SDCS** - this is the **SD** card **C** hip **S** elect, required for communicating with the onboard SD card holder. You can leave this disconnected if you aren't going to access SD cards
- **RST** - this is the E-Ink **R** e **S** e **T** pin, you may be able to share this with your microcontroller reset pin but if you can, connect it to a digital pin.
- **BUSY** - this is the e-Ink busy detect pin, and is optional if you don't want to connect the pin (in which case the code will just wait an approximate number of seconds).

# Adafruit 2.7" eInk Display Breakouts and Shields

## EYESPI

Primary: 

![](https://cdn-learn.adafruit.com/assets/assets/000/119/995/medium800/raspberry_pi_4098-07.jpg?1680271402)

This display now comes with an **EYESPI connector**. This connector allows you to connect your display without soldering. There are [EYESPI cables](https://www.adafruit.com/?q=eyespi+cable&sort=BestMatch) available in multiple lengths, which means you can find one to fit any project. This is especially useful if your project requires the display to be freestanding, and not tied directly into a breadboard. Inspired by the popularity of STEMMA QT, it provides plug-n-play for displays!

## The EYESPI Connector and Cables

The EYESPI connector is an 18 pin 0.5mm pitch FPC connector with a flip-top tab for locking in the associated flex cable. It is designed to allow you to connect a display, without needing to solder headers or wires to the display.

The EYESPI connector location on this display is indicated below.

![](https://cdn-learn.adafruit.com/assets/assets/000/119/994/medium800/raspberry_pi_eyeSpiCallout2.7.jpg?1680271250)

The EYESPI cables are 18 pin 0.5mm pitch flex cables. They are ~9.6mm wide, and designed to fit perfectly into the EYESPI connector. Adafruit currently offers EYESPI cables in three different lengths: [50mm](https://www.adafruit.com/product/5462), [100mm](https://www.adafruit.com/product/5239), and [200mm](https://www.adafruit.com/product/5240).

Warning: 

## Wiring Your EYESPI Display

Wiring your EYESPI display to a microcontroller via the EYESPI connector requires the EYESPI breakout board and an EYESPI cable.

### Adafruit EYESPI Breakout Board - 18 Pin FPC Connector

[Adafruit EYESPI Breakout Board - 18 Pin FPC Connector](https://www.adafruit.com/product/5613)
Our most recent [display breakouts have come with a new feature:&nbsp;an 18-pin "EYE SPI" standard FPC connector with flip-top connector](https://www.adafruit.com/?q=eyespi&sort=BestMatch). This is intended to be a sort-of "<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/5613)
[Related Guides to the Product](https://learn.adafruit.com/products/5613/guides)
![Overhead video of a 1.9" TFT display connected via 18-pin FPC ribbon cable to a square-shaped microcontroller on a breadboard. The TFT plays an animated boot-up demo.](https://cdn-shop.adafruit.com/product-videos/640x480/5613-06.jpg)

### EYESPI Cable - 18 Pin 100mm long Flex PCB (FPC) A-B type

[EYESPI Cable - 18 Pin 100mm long Flex PCB (FPC) A-B type](https://www.adafruit.com/product/5239)
Connect this to that when a 18-pin FPC connector is needed. This 25 cm long cable is made of a flexible PCB. It's A-B style which means that pin one on one side will match with pin one on the other side. How handy!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/5239)
[Related Guides to the Product](https://learn.adafruit.com/products/5239/guides)
![Angled shot of a EYESPI Cable - 18 Pin 100mm long Flex PCB (FPC) A-B type. ](https://cdn-shop.adafruit.com/640x480/5239-00.jpg)

The following example shows how to connect the 2.7" eInk Display breakout to a Feather RP2040 using the EYESPI breakout board.

Warning: 

Connect the following Feather pins to the associated EYESPI breakout pins:

- **Breakout Vin** to **Feather Vin (red wire)**
- **Breakout Gnd** to **Feather Gnd (black wire)**
- **Breakout SCK** to **Feather SCK (blue wire)**
- **Breakout MOSI** to **Feather MOSI (yellow wire)**
- **Breakout MISO** to **Feather MISO (green wire)**
- **Breakout MEMCS** to **Feather pin 6 (pink wire)**
- **Breakout TCS** to **Feather pin 9 (grey wire)**
- **Breakout DC** to **Feather pin 10 (white wire)**
- **Breakout RST** to **Feather pin 11 (orange wire)**
- **Breakout BUSY** to **Feather pin 12 (cyan wire)**
- **Breakout SDCS** to **Feather pin 13 (purple wire)**

![raspberry_pi_2.7_eInk_TriColor_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/119/996/medium640/raspberry_pi_2.7_eInk_TriColor_bb.jpg?1680271559)

Finally, connect your **display EYESPI connector** to the **breakout EYESPI connector** using an **EYESPI cable**. For details on using the EYESPI connector properly, visit [Plugging in an EYESPI Cable](https://learn.adafruit.com/adafruit-eyespi-breakout-board/plugging-in-an-eyespi-cable).

## EYESPI Pins

Though there are 18 pins available on the EYESPI connector, many displays do not use all available pins. This display requires the following pins:

- **Vin** - This is the power pin. To power the board (and thus your display), connect to the same power as the logic level of your microcontroller, e.g. for a 3V micro like a Feather, use 3V, and for a 5V micro like an Arduino, use 5V
- **GND** - This is common ground for power and logic
- **SCK** - This is the SPI clock input pin
- **MOSI** &nbsp;- This is the SPI MOSI ( **M** icrocontroller **O** ut / **S** erial **I** n) pin. It is used to send data from the microcontroller to the SD card and/or display
- **MISO** &nbsp;- This is the SPI MISO ( **M** icrocontroller **I** n / **S** erial **O** ut) pin. It's used for the SD card. It isn't used for the display because it's write-only. It is 3.3V logic out (but can be read by 5V logic)
- **TCS** - eInk Chip Select pin
- **DC** - Data/command pin
- **MEMCS** - **Mem** ory&nbsp; **C** hip **S** elect, required for communicating with the onboard RAM chip
- **RST** - This is the display reset pin. Connecting to ground resets the display! It's best to have this pin controlled by the library so the display is reset cleanly, but you can also connect it to the microcontroller's Reset pin, which works for most cases. Often, there is an automatic-reset chip on the display which will reset it on power-up, making this connection unnecessary in that case
- **BUSY** - e-Ink busy detect pin
- **SDCS** - This is the SD card chip select pin. This pin is required for communicating with the SD card holder onboard the connected display

# Adafruit 2.7" eInk Display Breakouts and Shields

## Plugging in an EYESPI Cable

![](https://cdn-learn.adafruit.com/assets/assets/000/116/975/medium800/adafruit_products_edited_P1390328.jpg?1670356850)

You can connect an EYESPI compatible display to the EYESPI breakout board using an EYESPI cable. An EYESPI cable is an 18 pin flexible PCB (FPC). The FPC can only be connected properly in one orientation, so be sure to follow the steps below to ensure that your display and breakout are plugged in properly.

Each EYESPI cable has **blue stripes** on either end. On the other side of the cable, underneath the blue stripe, are the connector pins that make contact with the FPC connector pins on the display or breakout.

![adafruit_products_cableStripe.gif](https://cdn-learn.adafruit.com/assets/assets/000/116/970/medium640thumb/adafruit_products_cableStripe.jpg?1670356463)

To begin inserting an EYESPI cable to an FPC connector, gently lift the FPC connector black latch up.&nbsp;

![adafruit_products_liftLatch.gif](https://cdn-learn.adafruit.com/assets/assets/000/116/971/medium640thumb/adafruit_products_liftLatch.jpg?1670356608)

Then, insert the EYESPI cable into the open FPC connector by sliding the cable into the connector. You want to **see the blue stripe facing up towards you**. This inserts the cable pins into the FPC connector.

![adafruit_products_insertCable.gif](https://cdn-learn.adafruit.com/assets/assets/000/116/972/medium640thumb/adafruit_products_insertCable.jpg?1670356741)

To secure the cable, lower the FPC connector latch onto the EYESPI cable.

![adafruit_products_lowerLatch.gif](https://cdn-learn.adafruit.com/assets/assets/000/116/973/medium640thumb/adafruit_products_lowerLatch.jpg?1670356793)

Repeat this process for the FPC connector on your display. Again, ensure that the **blue stripe** on either end of the cable is facing up.

![adafruit_products_edited_P1390333.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/974/medium640/adafruit_products_edited_P1390333.jpg?1670356806)

# Adafruit 2.7" eInk Display Breakouts and Shields

## Shield Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/074/553/medium800/adafruit_products_4229-04.jpg?1555473379)

The 2.7" EInk Shield is a little special in that the pins are fixed, so we'll document that here.

# Power Pins

- **5V** - this pin on the Arduino is used to generate the 3V logic level for the EInk chip, level shifter and boost converter.
- **GND** - connected for power and logic reference
- **IORef** - this pin is connected to the level shifter and pullups. On modern Arduino boards it is connected to the logic level of the board (3V or 5V)

# Data Pins

- **SCK, MISO, MOSI** - The 3 SPI logic pins are connected through the 2x3 socket header which is compatible with any Arduino board. If you have an Arduino board without the 2x3 headers, you can cut the jumpers and connect the solder jumper traces to D13, D12 and D11 respectively.
- **ECS** (EInk Chip Select) - this is connected to **D10**
- **DC** (EInk Data/Command) - this is connected to **D9**
- **SCS** (SRAM Chip Select) - this is connected to **D8**
- **SDCS** (SD Card Chip Select) - this is connected to **D5**

The **BUSY** pin is not used on the 2.7" display (it doesn't do anything anyways)

The **RESET** pin is connected to the microcontroller reset pin, but is available on a pad labeled **EReset** if you want to toggle it yourself!

# Buttons

The 4 buttons on the front are connected through a resistor divider to **A3** you can use this function to determine what button was pressed:

```
int8_t readButtons(void) {
  uint16_t reading = analogRead(A3);
  //Serial.println(reading);

  if (reading &gt; 600) {
    return 0; // no buttons pressed
  }
  if (reading &gt; 400) {
    return 4; // button D pressed
  }
  if (reading &gt; 250) {
    return 3; // button C pressed
  }
  if (reading &gt; 125) {
    return 2; // button B pressed
  }
  return 1; // Button A pressed
}
```

Here's a simple test example for an Arduino with standard pin numbers:

```python
/***************************************************
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/

#include "Adafruit_ThinkInk.h"

#define EPD_DC      9 // can be any pin, but required!
#define EPD_CS      10  // 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     8  // 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.7" Tricolor Featherwing or Breakout with IL91874 chipset
ThinkInk_270_Tricolor_C44 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);


void setup() {
  Serial.begin(115200);
  while (!Serial) { delay(10); }
  Serial.println("Adafruit EPD full update test in red/black/white");
  display.begin(THINKINK_TRICOLOR);
  display.setRotation(2);
}

void loop() {
  Serial.println("Banner demo");
  display.clearBuffer();
  display.setTextSize(3);
  display.setCursor((display.width() - 144)/2, (display.height() - 24)/2);
  display.setTextColor(EPD_BLACK);
  display.print("Tri");  
  display.setTextColor(EPD_RED);
  display.print("Color");  
  display.display();

  delay(15000);
  
  Serial.println("Color rectangle demo");
  display.clearBuffer();
  display.fillRect(display.width()/3, 0, display.width()/3, display.height(), EPD_BLACK);
  display.fillRect((display.width()*2)/3, 0, display.width()/3, display.height(), EPD_RED);
  display.display();

  delay(15000);
  
  Serial.println("Text demo");
  // large block of text
  display.clearBuffer();
  display.setTextSize(1);
  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. ", EPD_BLACK);
  display.display();

  delay(15000);

  display.clearBuffer();
  for (int16_t i=0; i&lt;display.width(); i+=4) {
    display.drawLine(0, 0, i, display.height()-1, EPD_BLACK);
  }

  for (int16_t i=0; i&lt;display.height(); i+=4) {
    display.drawLine(display.width()-1, 0, 0, i, EPD_RED);
  }
  display.display();

  delay(15000);  
}


void testdrawtext(char *text, uint16_t color) {
  display.setCursor(0, 0);
  display.setTextColor(color);
  display.setTextWrap(true);
  display.print(text);
}
```

# Adafruit 2.7" eInk Display Breakouts and Shields

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/071/151/medium800/adafruit_products_3625-04.jpg?1550175621)

## Assembly
Cut the header down to length if necessary. It will be easier to solder if you insert it into a breadboard -&nbsp; **long pins down**

![](https://cdn-learn.adafruit.com/assets/assets/000/071/150/medium800/adafruit_products_DSC_4034.jpg?1550175608)

## Add the E-Ink Display

&nbsp;

Place the board over the pins so that the short pins poke through the top of the breakout pads

![adafruit_products_DSC_4035.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/152/medium640/adafruit_products_DSC_4035.jpg?1550175646)

## And Solder!

&nbsp;

Be sure to solder all pins for reliable electrical contact.  
  
_(For tips on soldering, be sure to check out the&nbsp;_[_Guide to Excellent Soldering_](http://learn.adafruit.com/adafruit-guide-excellent-soldering)_)._

![adafruit_products_DSC_4036.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/153/medium640/adafruit_products_DSC_4036.jpg?1550175659)

![adafruit_products_DSC_4041.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/154/medium640/adafruit_products_DSC_4041.jpg?1550175694)

![adafruit_products_DSC_4043.jpg](https://cdn-learn.adafruit.com/assets/assets/000/071/156/medium640/adafruit_products_DSC_4043.jpg?1550176791)

OK, you're done!

![](https://cdn-learn.adafruit.com/assets/assets/000/071/155/medium800/adafruit_products_DSC_4044.jpg?1550176756)

# Adafruit 2.7" eInk Display Breakouts and Shields

## Wiring

## Breakout Wiring

Though it looks like a lot of connections, wiring up an eInk breakout is pretty straightforward! Below shows using hardware SPI to connect it to an Adafruit Metro M4.

- **Vin** connects to the microcontroller board's **5V** or **3.3V** power supply pin.
- **GND** connects to ground.
- **CLK** connects to SPI clock. It's easiest to connect it to **pin 3 of the ICSP header**.
- **MOSI** connects to SPI MOSI. It's easiest to connect it to **pin 4 of the ICSP header**.
- **MISO** connects to SPI MISO. It's easiest to connect it to **pin 1 of the ICSP header**.
- **ECS** connects to our e-Ink Chip Select pin. We'll be using **Digital 9.**
- **D/C** connects to our e-Ink data/command select pin. We'll be using **Digital 10**.
- **SRCS** connects to our SRAM Chip Select pin. We'll be using **Digital 6.**
- **RST** connects to our e-Ink reset pin. We'll be using **Digital 8**.
- **BUSY** connects to our e-Ink busy pin. We'll be using **Digital 7**.
- **SDCS** connects to our SD Card Chip Select pin. We'll be using **Digital 5**.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/817/medium800/raspberry_pi_Untitled.jpg?1652815980)

## Python Wiring
There are many Single Board Computers (SBC) so showing them all is impractical. The Raspberry Pi is the most common and it is shown below. Others are likely similar. The SPI peripheral may need to be enabled on such boards.

- **Raspberry Pi 3.3** to **display VIN**
- **Raspberry Pi GND** to **display GND**
- **Raspberry Pi SCLK** to **display SCK**
- **Raspberry Pi MOSI** to **display MOSI**
- **Raspberry Pi GPIO CE0** to **display ECS**
- **Raspberry Pi GPIO 22** to **display D/C**
- **Raspberry Pi GPIO 27** to **display RST**
- **Raspberry Pi GPIO 17** to **display BUSY**

![](https://cdn-learn.adafruit.com/assets/assets/000/122/321/medium800/raspberry_pi_Python_bb.jpg?1688666810)

# Adafruit 2.7" eInk Display Breakouts and Shields

## Usage & Expectations

![](https://cdn-learn.adafruit.com/assets/assets/000/057/633/medium800thumb/adafruit_products_ezgif-5-28d9bfb373.jpg?1531711106)

One thing to remember with these small e-Ink screens is that its _very slow_ compared to OLEDs, TFTs, or even 'memory displays'. **It will take may seconds to fully erase and replace an image**

There's also a recommended limit on refeshing - **you shouldn't refresh or change the display more than every 3 minutes (180 seconds)**.

You don't have to refresh often, but with tri-color displays, the larger red ink dots will slowly rise, turning the display pinkish instead of white background. **To keep the background color clear and pale, refresh once a day**

Danger: 

# Adafruit 2.7" eInk Display Breakouts and Shields

## Arduino Setup

To use the display, you will need to [install the Adafruit\_EPD library (code on our github repository)](https://github.com/adafruit/Adafruit_EPD "Link: https://github.com/adafruit/Adafruit\_EPD"). It is available from the Arduino library manager so we recommend using that.

From the IDE open up the library manager...

![](https://cdn-learn.adafruit.com/assets/assets/000/096/249/medium800/adafruit_products_Manage_Libraries.png?1603397012)

And type in **adafruit EPD** to locate the library. Click **Install**

![](https://cdn-learn.adafruit.com/assets/assets/000/099/572/medium800/eink___epaper_EPD_Library.png?1613582249)

If you would like to draw bitmaps, do the same with **adafruit ImageReader** , click **Install**

![](https://cdn-learn.adafruit.com/assets/assets/000/099/571/medium800/eink___epaper_Image_Reader.png?1613582239)

Do the same to install the latest **adafruit GFX** library, click **Install**

![](https://cdn-learn.adafruit.com/assets/assets/000/096/250/medium800/adafruit_products_arduino_compatibles_adafruit-gfx-library-manager.png?1603397155)

If using an earlier version of the Arduino IDE (pre-1.8.10), locate and install **Adafruit\_BusIO** (newer versions handle this prerequisite automatically).

# Adafruit 2.7" eInk Display Breakouts and Shields

## Arduino Usage

Danger: 

## 2.7" Tri-Color 264x176 Pixel Display

For the 264x176 Tri-Color displays, below is a tri-color demo.

Warning: 

### Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM

[Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM](https://www.adafruit.com/product/4098)
Easy e-paper finally comes to microcontrollers, with this breakout that's designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those new-fangled 'e-readers' like the Kindle or Nook. They have gigantic electronic paper 'static'...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4098)
[Related Guides to the Product](https://learn.adafruit.com/products/4098/guides)
![Angled shot of a Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM - Red Black White.](https://cdn-shop.adafruit.com/640x480/4098-05.jpg)

### Adafruit 2.7" Tri-Color eInk / ePaper Shield with SRAM

[Adafruit 2.7" Tri-Color eInk / ePaper Shield with SRAM](https://www.adafruit.com/product/4229)
Easy e-paper finally comes to microcontrollers, with this breakout that's designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those new-fangled 'e-readers' like the Kindle or Nook. They have gigantic electronic paper 'static'...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4229)
[Related Guides to the Product](https://learn.adafruit.com/products/4229/guides)
![Top down view of a Adafruit 2.7" Tri-Color eInk / ePaper Shield with SRAM - Red Black White. ](https://cdn-shop.adafruit.com/640x480/4229-05.jpg)

Warning: 

Open up&nbsp; **File→Examples→Adafruit\_EPD→ThinkInk\_tricolor**

![](https://cdn-learn.adafruit.com/assets/assets/000/099/465/medium800/eink___epaper_Open_Demo_Tricolor.png?1613435446)

## Configure Pins
No matter what display you have, you will need to verify that your pins match your wiring. At the top of the sketch find the lines that look like:

```cpp
#define EPD_DC      10
#define EPD_CS      9
#define SRAM_CS     6
#define EPD_RESET   8 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY    7 // can set to -1 to not use a pin (will wait a fixed delay)
```

If you wired the display differently than on the wiring page, adjust the pin numbers accordingly.

### Shield Configuration

For the shield, since the pins are fixed, you can just use these settings:

```auto
#define EPD_DC      9
#define EPD_CS      10
#define SRAM_CS     8
#define EPD_RESET   -1
#define EPD_BUSY    -1
```

## Configure Display Type & Size

Find the part of the script where you can pick which display is going to be used. The eInk displays are made up a combination of a Chipset and a Film in different sizes. Adafruit has narrowed it down to just a few choices between the size of the display, chipset, and film based on available combinations. In the sketch, it is sorted by size, so it's easy to find your display.

For the **ILI91874** display, you will use the `ThinkInk_270_Tricolor_C44` display initializer.

Just uncomment these lines, and comment out any other line that is creating a ThinkInk display object

```cpp
// ThinkInk_270_Tricolor_C44 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
// EPD_BUSY, EPD_SPI);
```

For the **EK79686** display, you will use the `ThinkInk_270_Tricolor_Z70`&nbsp;display initializer.

Just uncomment these lines, and comment out any other line that is creating a ThinkInk display object

```cpp
// ThinkInk_270_Tricolor_Z70 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
// EPD_BUSY, EPD_SPI);
```

## Upload Sketch

After checking the pinouts and the display type one more time, go ahead and upload the sketch to your board. Once it is done uploading, open the **Serial Monitor**.

The display should start running a series of display tests

![](https://cdn-learn.adafruit.com/assets/assets/000/096/259/medium800/adafruit_products_Serial_Monitor.png?1603405703)

![](https://cdn-learn.adafruit.com/assets/assets/000/100/707/medium800thumb/eink___epaper_Arduino_Demo.jpg?1615493150)

# Adafruit 2.7" eInk Display Breakouts and Shields

## Arduino Bitmaps

![](https://cdn-learn.adafruit.com/assets/assets/000/111/686/medium800/raspberry_pi_4229-05.jpeg?1652379155)

Not only can you draw shapes but you can also load images from the SD card, perfect for static images!

## Tri-Color Display Demo

The Tri-color demo uses a single bitmap. The Blinka bitmaps below is used for the demonstration. Select the one that is correct for your display:

![](https://cdn-learn.adafruit.com/assets/assets/000/111/693/medium800/raspberry_pi_blinka.bmp?1652389902)

[Download Tri-Color blinka.bmp](https://github.com/adafruit/Adafruit_ImageReader/raw/master/images/E-Ink%20TriColor%202.7/blinka.bmp)
Download the&nbsp; **blinka.bmp** &nbsp;file and place it into the base directory of a microSD card and insert it into the microSD socket in the breakout.

Plug the MicroSD card into the display. You may want to try the&nbsp; **SD library** &nbsp;examples before continuing, especially one that lists all the files on the SD card

Open the&nbsp; **file→examples→Adafruit\_ImageReader→ThinkInkDisplay**** s**&nbsp;example

![](https://cdn-learn.adafruit.com/assets/assets/000/104/652/medium800/eink___epaper_ThinkInkDisplays_Example.png?1631721166)

There are just a couple of things you may need to change in this file.

You will need to change your initializer to use `ThinkInk_270_Tricolor_C44`.

If you are using the shield, use these pin configurations:

```cpp
#define EPD_DC      9
#define EPD_CS      10
#define SRAM_CS     8
#define EPD_RESET   -1
#define EPD_BUSY    -1
#define SD_CS       5
```

Upload to your board and you should see an image of Blinka appear.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/692/medium800thumb/raspberry_pi_4098-00.jpg?1652381811)

If you want to later use your own image, use an image editing tool and crop your image to no larger than 264 pixels wide and 176 pixels high. Save it as a 24-bit color **BMP** file - it must be 24-bit color format to work, even if it was originally a 16-bit color image - because of the way BMPs are stored and displayed!

# Adafruit 2.7" eInk Display Breakouts and Shields

## CircuitPython Usage

Danger: 

## CircuitPython eInk displayio Library Installation

To use displayio, you will need to install the appropriate library for your display.&nbsp;

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython) for your board. You will need the latest version of CircuitPython.

Next you'll need to install the necessary libraries&nbsp;to use the hardware--carefully follow the steps to find and install these libraries from&nbsp;[Adafruit's CircuitPython library bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle).&nbsp; The introduction guide has [a great page on how to install the library bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries) for both Express and non-Express boards.

You will need to copy the appropriate displayio driver from the bundle **lib** folder to a **lib** folder on your **CIRCUITPY** drive. The displayio driver contains the initialization codes specific to your display that are needed to for it to work. Since there is more than one driver, you will need to copy the correct file over. Here is a list of each of the displays and the correct driver for that display.

Warning: 

## Adafruit\_CircuitPython\_IL91874
Warning: 

The 2.7" Tri-Color shield and older 2.7" Tri-Color breakout (without the EYESPI connector) use the **Adafruit\_CircuitPython\_IL91874** &nbsp;library. To easily get all the required files and libraries, you can click the **Download Project Bundle** link at the top of the appropriate example code below. Just unzip, open the folder that corresponds to the version of CircuitPython you have installed, and copy the contents to the **CIRCUITPY** drive.

### Adafruit 2.7" Tri-Color eInk / ePaper Shield with SRAM

[Adafruit 2.7" Tri-Color eInk / ePaper Shield with SRAM](https://www.adafruit.com/product/4229)
Easy e-paper finally comes to microcontrollers, with this breakout that's designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those new-fangled 'e-readers' like the Kindle or Nook. They have gigantic electronic paper 'static'...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4229)
[Related Guides to the Product](https://learn.adafruit.com/products/4229/guides)
![Top down view of a Adafruit 2.7" Tri-Color eInk / ePaper Shield with SRAM - Red Black White. ](https://cdn-shop.adafruit.com/640x480/4229-05.jpg)

## Adafruit\_CircuitPython\_EK79686

The newer 2.7" Tri-Color Display breakout (with the EYESPI connector) use the **Adafruit\_CircuitPython\_EK79686** &nbsp;library. To easily get all the required files and libraries, you can click the **Download Project Bundle** link at the top of the appropriate example code below. Just unzip, open the folder that corresponds to the version of CircuitPython you have installed, and copy the contents to the **CIRCUITPY** drive.

### Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM

[Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM](https://www.adafruit.com/product/4098)
Easy e-paper finally comes to microcontrollers, with this breakout that's designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those new-fangled 'e-readers' like the Kindle or Nook. They have gigantic electronic paper 'static'...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4098)
[Related Guides to the Product](https://learn.adafruit.com/products/4098/guides)
![Angled shot of a Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM - Red Black White.](https://cdn-shop.adafruit.com/640x480/4098-05.jpg)

## Image File

To show you how to use the eInk with displayio, below shows you how to draw a bitmap onto it. First start by downloading **display-ruler.bmp**

[Download display-ruler.bmp](https://github.com/adafruit/Adafruit_CircuitPython_IL91874/raw/main/examples/display-ruler.bmp)
Copy **display-ruler.bmp** into the root directory of your **CIRCUITPY** drive.

## Tri-Color Display Usage
### 2.7" 264x176 HD Tri-Color Breakout with EYESPI

In the examples folder for your EK79686 displayio driver, there should be a test for your display which we have listed here:

https://github.com/adafruit/Adafruit_CircuitPython_EK79686/blob/main/examples/ek79686_simpletest.py

### 2.7" 264x176 HD Tri-Color Shield and non-EYESPI&nbsp;Breakout

In the examples folder for your IL91874 displayio driver, there should be a test for your display which we have listed here:

https://github.com/adafruit/Adafruit_CircuitPython_IL91874/blob/main/examples/il91874_simpletest.py

### Update the Settings
In either example, you will want to double-check your settings.

For the breakout, you will want to change the `epd_reset` and `epd_busy` to **the correct values**. If you wired it up as shown on the Wiring page, you will want to change it to these values:

```python
epd_reset = board.D8
epd_busy = board.D7
```

For the shield, you will want to change both of these values to `None`:

```python
epd_reset = None
epd_busy = None
```

The rotation of the breakout is 180 degrees different from the shield, so you may want to change the `rotation` value from **90** to **270** :

```python
rotation=270
```

Save it to your&nbsp; **CIRCUITPY** &nbsp;drive as&nbsp; **code.py** &nbsp;and it should automatically run. Your display will look something like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/111/742/medium800/raspberry_pi_IMG_4239.jpeg?1652726324)

# Adafruit 2.7" eInk Display Breakouts and Shields

## Python Setup

It's easy to use eInk breakouts with Python and the&nbsp;[Adafruit CircuitPython EPD](https://github.com/adafruit/Adafruit_CircuitPython_EPD)&nbsp;library.&nbsp; This library allows you to easily write Python code to control the display.

Since there are&nbsp;_dozens_&nbsp;of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms,&nbsp;[please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Info: 

Warning: 

## Setup Virtual Environment

If you are installing on the Bookworm version of Raspberry Pi OS or later, you will need to install your python modules in a virtual environment. You can find more information in the&nbsp;[Python Virtual Environment Usage on Raspberry Pi](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi)&nbsp;guide. To Install and activate the virtual environment, use the following commands:

```terminal
sudo apt install python3-venv
python -m venv env --system-site-packages
```

To activate the virtual environment:

```terminal
source env/bin/activate
```

## Install Adafruit\_Blinka

You'll need to install the&nbsp; **Adafruit\_Blinka** library that provides the CircuitPython support in Python. This may also require enabling SPI on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

## Python Installation of EPD Library

Once that's done, from your command line run the following command:

```terminal
pip3 install adafruit-circuitpython-epd
```

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

If that complains about pip3 not being installed, then run this first to install it:

```terminal
sudo apt-get install python3-pip
```

## Download font5x8.bin

**This library also requires a font file to run!** You can download it below. Before continuing, make sure the folder you are running scripts from&nbsp;contains the **font5x8.bin** file.

[Download font5x8.bin](https://github.com/adafruit/Adafruit_CircuitPython_framebuf/raw/main/examples/font5x8.bin)
Alternatively, you can use `wget` to directly download the file to your pi:

```terminal
wget https://github.com/adafruit/Adafruit_CircuitPython_framebuf/raw/main/examples/font5x8.bin
```

## DejaVu TTF Font

Raspberry Pi usually comes with the DejaVu font already installed, but in case it didn't, you can run the following to install it:

```terminal
sudo apt-get install fonts-dejavu
```

This package was previously calls **ttf-dejavu** , so if you are running an older version of Raspberry Pi OS, it may be called that.

## Pillow Library

Some of the examples also use PIL, the Python Imaging Library, to allow graphics and using text with custom fonts. There are several system libraries that PIL relies on, so installing via a package manager is the easiest way to bring in everything:

```terminal
sudo apt-get install python3-pil
```

## Chip Enable Lines

Follow [these instructions](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/spi-sensors-devices#reassigning-or-disabling-the-spi-chip-enable-lines-3097985) for dealing with SPI chip enable line issues.

That's it. You should be ready to go.

# Adafruit 2.7" eInk Display Breakouts and Shields

## Python Usage

Warning: 

Warning: 

To demonstrate the usage of the display, we'll initialize it and draw some lines from the Python REPL.

Run the following code to import the necessary modules and set up the pin assignments. The SRAM CS pin is set to `None` because the Raspberry Pi has lots of RAM, so you don't really need it.

```python
import digitalio
import busio
import board
from adafruit_epd.epd import Adafruit_EPD

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.CE0)
dc = digitalio.DigitalInOut(board.D22)
rst = digitalio.DigitalInOut(board.D27)
busy = digitalio.DigitalInOut(board.D17)
srcs = None
```

Info: 

Run the following code to initialize the display.

Warning: 

### Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM

[Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM](https://www.adafruit.com/product/4098)
Easy e-paper finally comes to microcontrollers, with this breakout that's designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those new-fangled 'e-readers' like the Kindle or Nook. They have gigantic electronic paper 'static'...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4098)
[Related Guides to the Product](https://learn.adafruit.com/products/4098/guides)
![Angled shot of a Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM - Red Black White.](https://cdn-shop.adafruit.com/640x480/4098-05.jpg)

For the newer EYESPI **EK79686** 2.7" 264x176 Tri-Color Display:

```python
from adafruit_epd.ek79686 import Adafruit_EK79686
display = Adafruit_EK79686(176, 264, spi, cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs, rst_pin=rst, busy_pin=busy)
```

For the older non-EYESPI **IL91874** 2.7" 264x176 Tri-Color Display:

```python
from adafruit_epd.il91874 import Adafruit_IL91874
display = Adafruit_IL91874(176, 264, spi, cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs, rst_pin=rst, busy_pin=busy)
```

## Tri-Color Example

The Tri-Color example is almost the same as the monochrome example, except another color is added in. Once done drawing, the code needs to tell the screen to update using the `display()` method.

```python
display.rotation = 3
display.fill(Adafruit_EPD.WHITE)

display.fill_rect(20, 20, 50, 60, Adafruit_EPD.RED)
display.hline(80, 30, 60, Adafruit_EPD.BLACK)
display.vline(80, 30, 60, Adafruit_EPD.BLACK)

display.display()
```

Your display will look something like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/111/746/medium800/raspberry_pi_IMG_4245.jpeg?1652743181)

That's all there is to drawing simple shapes with eInk displays and CircuitPython!

# Full Example Code

Here is the full example code.

Info: 

https://github.com/adafruit/Adafruit_CircuitPython_EPD/blob/main/examples/epd_simpletest.py

# Bitmap Example

Here's a complete example of how to display a bitmap image on your display. **Note that any .bmp image you want to display must be exactly the size of your display.** The image below will be used on the 2.7" display. Click the button below to download the image and save it as **blinka.bmp** on your Raspberry Pi. The code uses a Tri-Color bitmap, but it should still work on a monochrome display.

[Click here to download blinka for the 2.7" Tri-Color display](https://github.com/adafruit/Adafruit_ImageReader/raw/master/images/E-Ink%20TriColor%202.7/blinka.bmp)
Save the following code to your Raspberry Pi as **epd\_bitmap.py**.

https://github.com/adafruit/Adafruit_CircuitPython_EPD/blob/main/examples/epd_bitmap.py

Before running it, you will need to change a few pin definitions. Find the section of code that looks like this:

```python
ecs = digitalio.DigitalInOut(board.D10)
dc = digitalio.DigitalInOut(board.D9)
srcs = digitalio.DigitalInOut(board.D7)    # can be None to use internal memory
rst = digitalio.DigitalInOut(board.D11)    # can be None to not use this pin
busy = digitalio.DigitalInOut(board.D12)   # can be None to not use this pin
```

Change the pins to the following to match the wiring on the Raspberry Pi:

```python
ecs = digitalio.DigitalInOut(board.CE0)
dc = digitalio.DigitalInOut(board.D22)
srcs = None
rst = digitalio.DigitalInOut(board.D27)
busy = digitalio.DigitalInOut(board.D17)
```

Next, find the section that looks like this:

```python
# display = Adafruit_SSD1608(200, 200,        # 1.54" HD mono display
# display = Adafruit_SSD1675(122, 250,        # 2.13" HD mono display
# display = Adafruit_SSD1680(122, 250,        # 2.13" HD Tri-color display
# display = Adafruit_SSD1681(200, 200,        # 1.54" HD Tri-color display
# display = Adafruit_IL91874(176, 264,        # 2.7" Tri-color display
# display = Adafruit_IL0373(152, 152,         # 1.54" Tri-color display
# display = Adafruit_UC8151D(128, 296,        # 2.9" mono flexible display
# display = Adafruit_IL0373(128, 296,         # 2.9" Tri-color display
# display = Adafruit_IL0398(400, 300,         # 4.2" Tri-color display
display = Adafruit_IL0373(
    104,
    212,  # 2.13" Tri-color display
    spi,
    cs_pin=ecs,
    dc_pin=dc,
    sramcs_pin=srcs,
    rst_pin=rst,
    busy_pin=busy,
)
```

 **Comment out** these lines:

```python
display = Adafruit_IL0373(
    104,
    212,  # 2.13" Tri-color display
```

and **uncomment** the line that corresponds with the initializer for your display.&nbsp;

Next to tell the display the rotation setting desired. This can be a value between `0-3`. For the 2.7" displays, a value of `3` seems to work well.

```python
display.rotation = 3
```

Now go to the command prompt on your Raspberry Pi and run the script with the following command:

`python3 epd_bitmap.py`

After a few seconds, your display should show an image like this:

![](https://cdn-learn.adafruit.com/assets/assets/000/111/702/medium800/raspberry_pi_4098-04.jpeg?1652394923)

# Image Drawing with Pillow

This example will use Pillow to resize and crop the image automatically and draw it on the the ePaper Display. Pillow is really powerful and with it you can open and render additional file formats such as PNG or JPG. Start with downloading a PNG of blinka that has been adjusted down to 3 colors so it prints nicely on an ePaper Display. This uses a PNG format file because it is a lossless format and won't introduce unexpected colors on the display.

![](https://cdn-learn.adafruit.com/assets/assets/000/082/717/medium800/adafruit_products_blinka.png?1571699449)

Make sure you save it as&nbsp; **blinka.png** and place it in the same folder as your script. Here's the code to load onto the Raspberry Pi. Go ahead and copy it onto your Raspberry Pi and save it as **epd\_pillow\_image.py**.&nbsp;

https://github.com/adafruit/Adafruit_CircuitPython_EPD/blob/main/examples/epd_pillow_image.py

The code starts with library imports including a couple of Pillow modules and the ePaper display drivers.

```python
import digitalio
import busio
import board
from PIL import Image, ImageDraw
from adafruit_epd.il0373 import Adafruit_IL0373
from adafruit_epd.il91874 import Adafruit_IL91874
from adafruit_epd.il0398 import Adafruit_IL0398
from adafruit_epd.ssd1608 import Adafruit_SSD1608
from adafruit_epd.ssd1675 import Adafruit_SSD1675
from adafruit_epd.ssd1680 import Adafruit_SSD1680
from adafruit_epd.ssd1681 import Adafruit_SSD1681
from adafruit_epd.uc8151d import Adafruit_UC8151D
```

That is followed by initializing the SPI bus and defining a few pins. The choices allow you to use the same code with the EPD bonnets, if you chose to do so.

```python
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.CE0)
dc = digitalio.DigitalInOut(board.D22)
srcs = None
rst = digitalio.DigitalInOut(board.D27)
busy = digitalio.DigitalInOut(board.D17)
```

These examples work on as many displays as possible with very few changes. Go ahead and comment out the following lines:

`display = Adafruit_IL0373(    104,    212,  # 2.13" Tri-color display`

and uncomment the line appropriate for your display.&nbsp;

```python
#display = Adafruit_SSD1608(200, 200,        # 1.54" HD mono display
#display = Adafruit_SSD1675(122, 250,        # 2.13" HD mono display
#display = Adafruit_SSD1680(122, 250,        # 2.13" HD Tri-color display
#display = Adafruit_SSD1681(200, 200,        # 1.54" HD Tri-color display
#display = Adafruit_IL91874(176, 264,        # 2.7" Tri-color display
#display = Adafruit_IL0373(152, 152,         # 1.54" Tri-color display
#display = Adafruit_IL0373(128, 296,         # 2.9" Tri-color display
#display = Adafruit_IL0398(400, 300,         # 4.2" Tri-color display
display = Adafruit_IL0373(
    104,
    212,  # 2.13" Tri-color display
    spi,
    cs_pin=ecs,
    dc_pin=dc,
    sramcs_pin=srcs,
    rst_pin=rst,
    busy_pin=busy
)
```

Next change the rotation setting to&nbsp;`3`.

```python
display.rotation = 3
```

Next is to open the Blinka image, which is named **blinka.png** , and it is assumed the file is in the same directory that you are running the script from. Feel free to change it if it doesn't match your configuration.

```python
image = Image.open("blinka.png")
```

Here's where it starts to get interesting. It is desirable to scale the image so that it matches either the width or height of the display, depending on which is smaller, so that there may be some of the image to chop off when it is cropped. Start by calculating the width to height ratio of both the display and the image. If the height is the closer of the dimensions, you want to match the image height to the display height and let it be a bit wider than the display. Otherwise, you want to do the opposite.

Once you've figured out how to scale it, pass in the new dimensions and using a&nbsp; **Bicubic** &nbsp;rescaling method, the code reassigns the newly rescaled image back to&nbsp;`image`. Pillow has quite a few different methods to choose from, but Bicubic does a great job and is reasonably fast.

**Nearest** actually gives a little better result with the Tri-color eInks, but loses detail with displaying a color image on the monochrome display, so this code uses the best balance.

```python
image_ratio = image.width / image.height
screen_ratio = display.width / display.height
if screen_ratio &lt; image_ratio:
    scaled_width = image.width * display.height // image.height
    scaled_height = display.height
else:
    scaled_width = display.width
    scaled_height = image.height * display.width // image.width
image = image.resize((scaled_width, scaled_height), Image.BICUBIC)
```

Next to figure the starting x and y points of the image to begin cropping so that the image ends up centered. Do that by using a standard centering function, which is basically requesting the difference of the center of the display and the center of the image. Just like with scaling, replace the `image`&nbsp;variable with the newly cropped image.

```python
x = scaled_width // 2 - display.width // 2
y = scaled_height // 2 - display.height // 2
image = image.crop((x, y, x + display.width, y + display.height)).convert("RGB")
```

Finally, take the `image`, draw it to the frame buffer and `display` it. At this point, the image should have the exact same dimensions at the display and fill it completely.

```python
display.image(image)
display.display()
```

Now go to the command prompt on your Raspberry Pi and run the script with the following command:

`python3 epd_pillow_image.py`

After a few seconds, your display should show this image:

![](https://cdn-learn.adafruit.com/assets/assets/000/111/744/medium800/raspberry_pi_IMG_4246.jpeg?1652743149)

# Drawing Shapes and Text with Pillow

The next example takes a look at drawing shapes and text. This is very similar to the displayio example, but it uses Pillow instead. Go ahead and copy it onto your Raspberry Pi and save it as **epd\_pillow\_demo.py**. Here's the code for that.

https://github.com/adafruit/Adafruit_CircuitPython_EPD/blob/main/examples/epd_pillow_demo.py

Just like in the last example, use the imports, but this time include the `ImageDraw` and `ImageFont` Pillow modules to allow text rendering.

```python
import digitalio
import busio
import board
from PIL import Image, ImageDraw, ImageFont
from adafruit_epd.il0373 import Adafruit_IL0373
from adafruit_epd.il91874 import Adafruit_IL91874
from adafruit_epd.il0398 import Adafruit_IL0398
from adafruit_epd.ssd1608 import Adafruit_SSD1608
from adafruit_epd.ssd1675 import Adafruit_SSD1675
from adafruit_epd.ssd1680 import Adafruit_SSD1680
from adafruit_epd.ssd1681 import Adafruit_SSD1681
from adafruit_epd.uc8151d import Adafruit_UC8151D
```

Next to define some colors that can be used with Pillow.

```python
WHITE = (0xFF, 0xFF, 0xFF)
BLACK = (0x00, 0x00, 0x00)
RED = (0xFF, 0x00, 0x00)
```

After that, create some parameters that are easy to change. If you had a smaller display for instance, you could reduce the `FONTSIZE` and `BORDER` parameters. The&nbsp;`BORDER`&nbsp;will be the size in pixels of the green border between the edge of the display and the inner purple rectangle. The&nbsp;`FONTSIZE` will be the size of the font in points so that it can adjust easily for different displays. You could play around with the colors as well. One thing to note is that on monochrome displays, `RED` will show up as `BLACK`.

For the 2.7" display, a `BORDER` value of **20** and a `FONTSIZE` value of **24** looks good.

```python
BORDER = 10
FONTSIZE = 20
BACKGROUND_COLOR = BLACK
FOREGROUND_COLOR = WHITE
TEXT_COLOR = RED
```

After that, the initializer and rotation sections are exactly the same as in the previous example. **Go ahead and adjust your initializer as explained in the previous example.** After that, create an&nbsp;`image` with the dimensions and use that to create a `draw`&nbsp;object.&nbsp;&nbsp;The&nbsp;`draw` object will have all of the drawing functions.

```python
image = Image.new('RGB', (display.width, display.height))

draw = ImageDraw.Draw(image)
```

Next clear whatever is on the screen by drawing a rectangle using the `BACKGROUND_COLOR` that takes up the full screen.

```python
draw.rectangle((0, 0, display.width, display.height), fill=BACKGROUND_COLOR)
```

Next to draw an inner rectangle using the `FOREGROUND_COLOR`. Use the `BORDER` parameter to calculate the size and position to draw the rectangle.

```python
draw.rectangle((BORDER, BORDER, display.width - BORDER - 1, display.height - BORDER - 1),
               fill=FOREGROUND_COLOR)
```

Next to load a TTF font. The **DejaVuSans.ttf** font should come preloaded on your Pi in the location in the code. This will also make use of the `FONTSIZE` parameter discussed earlier.

```python
font = ImageFont.truetype('/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', FONTSIZE)
```

Now to draw the text Hello World onto the center of the display. You may recognize the centering calculation was the same one used to center crop the image in the previous example. In this example though, the font size values are obtained using the `getsize()`&nbsp;function of the font object.

```python
text = "Hello World!"
(font_width, font_height) = font.getsize(text)
draw.text((display.width//2 - font_width//2, display.height//2 - font_height//2),
          text, font=font, fill=TEXT_COLOR)
```

Finally, just like before, display the image.

```python
display.image(image)
display.display()
```

Now go to the command prompt on your Raspberry Pi and run the script with the following command:

`python3 epd_pillow_demo.py`

After a few seconds, your display should show this image:

![](https://cdn-learn.adafruit.com/assets/assets/000/111/745/medium800/raspberry_pi_IMG_4247.jpeg?1652743163)

# Adafruit 2.7" eInk Display Breakouts and Shields

## Downloads

## Files

- [Fritzing object in Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library)
- [IL91874 E-Ink interface chip datasheet](https://cdn-learn.adafruit.com/assets/assets/000/111/701/original/IL91874_DataSheet.pdf?1652393814)
- [PCB Files on GitHub](https://github.com/adafruit/Adafruit-E-Paper-Display-Breakout-PCBs)

## Schematic & Fabrication Prints

All dimensions are in inches.

### 2.7" Breakout with EYESPI
![](https://cdn-learn.adafruit.com/assets/assets/000/119/997/medium800/raspberry_pi_schem2.7.png?1680272618)

![](https://cdn-learn.adafruit.com/assets/assets/000/119/998/medium800/raspberry_pi_fab2.7.png?1680272628)

### 2.7" Breakout
![](https://cdn-learn.adafruit.com/assets/assets/000/057/645/medium800/adafruit_products_schem.png?1531712746)

![](https://cdn-learn.adafruit.com/assets/assets/000/071/122/medium800/adafruit_products_Adafruit_2.7in_eInk_Fab_Print.png?1550094819)

### 2.7" Shield
![](https://cdn-learn.adafruit.com/assets/assets/000/091/737/medium800/adafruit_products_2-7-in-eink-shield-sch.png?1591212452)

![](https://cdn-learn.adafruit.com/assets/assets/000/091/738/medium800/adafruit_products_2-7-in-eink-shield-fab-print.png?1591212460)


## Primary Products

### Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM

[Adafruit 2.7" Tri-Color eInk / ePaper Display with SRAM](https://www.adafruit.com/product/4098)
Easy e-paper finally comes to microcontrollers, with this breakout that's designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those new-fangled 'e-readers' like the Kindle or Nook. They have gigantic electronic paper 'static'...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4098)
[Related Guides to the Product](https://learn.adafruit.com/products/4098/guides)
### Adafruit 2.7" Tri-Color eInk / ePaper Shield with SRAM

[Adafruit 2.7" Tri-Color eInk / ePaper Shield with SRAM](https://www.adafruit.com/product/4229)
Easy e-paper finally comes to microcontrollers, with this breakout that's designed to make it a breeze to add a tri-color eInk display. Chances are you've seen one of those new-fangled 'e-readers' like the Kindle or Nook. They have gigantic electronic paper 'static'...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4229)
[Related Guides to the Product](https://learn.adafruit.com/products/4229/guides)

## Related Guides

- [Quickstart using Adafruit eInk/ePaper displays with CircuitPython](https://learn.adafruit.com/quickstart-using-adafruit-eink-epaper-displays-with-circuitpython.md)
- [Adafruit eInk Display Breakouts and FeatherWings](https://learn.adafruit.com/adafruit-eink-display-breakouts.md)
- [Tiny Autostereogram Construction Kit](https://learn.adafruit.com/tiny-autostereogram-construction-kit.md)
- [ePaper Maze Maker](https://learn.adafruit.com/epaper-maze-maker.md)
- [ePaper Calendar Featuring Metro M4 Express Airlift and Tri-Color ePaper Shield](https://learn.adafruit.com/epaper-calendar-featuring-metro-m4-express-airlift-and-epaper-shield.md)
- [eInk / ePaper Weather Station](https://learn.adafruit.com/epaper-weather-station.md)
- [MagTag AR Tarot Card Reading](https://learn.adafruit.com/magtag-tarot-cards.md)
- [Robotic AI Bear using ChatGPT](https://learn.adafruit.com/robotic-ai-bear-using-chatgpt.md)
- [Using Google Assistant on the BrainCraft HAT or Voice Bonnet](https://learn.adafruit.com/using-google-assistant-on-the-braincraft-hat.md)
- [Adafruit RP2040 Prop-Maker Feather](https://learn.adafruit.com/adafruit-rp2040-prop-maker-feather.md)
- [What's in the Box86? More gaming possibilities on Pi!](https://learn.adafruit.com/box86-gaming-on-arm-raspberry-pi.md)
- [Adding a Single Board Computer to PlatformDetect for Blinka](https://learn.adafruit.com/adding-a-single-board-computer-to-platformdetect-for-blinka.md)
- [Severance Portable Macrodata Refinement Terminal](https://learn.adafruit.com/portable-macrodata-refinement-terminal.md)
- [Scrolling Countdown Timer](https://learn.adafruit.com/scrolling-countdown-timer.md)
- [How to Add a New Board to CircuitPython](https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython.md)
