Source: https://mokxi.com/libraries/gxepd2
Updated: 2026-11-02

Libraries / Displays
Arduino library · Displays

# GxEPD2: drawing on an e-paper display

GxEPD2, by Jean-Marc Zingg, drives the SPI e-paper panels from Waveshare, Good Display and the others: the kind of screen that keeps its picture with the power off and is read like paper. It uses Adafruit GFX for drawing, so text and shapes work the way they do on an OLED.

Open the example in the editor See the calls

Built in on Mokxi: #include <GxEPD2_BW.h> and it builds, with nothing to install. Free, and no account needed.

## What GxEPD2 does

Two things are different from any other display. First, you pick a class for the exact panel, such as GxEPD2_213_BN or GxEPD2_290_T94, because each controller and glass has its own refresh sequence; the name is on the back of the panel or its listing. Second, a refresh takes a second or more and flashes the screen, and the panel signals that it is busy on a BUSY pin the library waits on.

Drawing uses a page loop like U8g2’s. The sketch draws inside firstPage() and nextPage(), and the library sends the picture in bands small enough to fit an Uno’s RAM. After the final page, hibernate() powers the panel down, and the picture stays.

Library Manager name | GxEPD2

Author | Jean-Marc Zingg

Include | #include <GxEPD2_BW.h>

Boards | every board Mokxi compiles for but ATtiny85

In the simulator | Runs, with a gap the note below names.

Parts it drives | E-paper display, SSD1680 2.13 inch, E-paper display, 2.9 inch

## Install it

It builds on every board Mokxi compiles for but ATtiny85.

In Mokxi it is built in: #include <GxEPD2_BW.h> and the sketch compiles, with no download, no zip and no Library Manager.

On a real board, install "GxEPD2" by Jean-Marc Zingg from the Arduino IDE’s Library Manager (Sketch, Include Library, Manage Libraries), or add GxEPD2 to lib_deps in PlatformIO. Mokxi follows the calls of release 1.6.2, so a sketch written here builds there too.

What to know in the simulator: The SSD1680 panels only (GxEPD2_213_BN, GxEPD2_290_BS, GxEPD2_290_T94, GxEPD2_290_T94_V2), without GFX fonts.

ESP32-C3 · Arduino Uno · Arduino Nano · Arduino Mega 2560 · Arduino Leonardo · SparkFun Pro Micro · Arduino Micro · ESP32-C6 · Raspberry Pi Pico · Raspberry Pi Pico W · Seeed XIAO SAMD21 · STM32 · STM32 Nucleo-F411RE · STM32 Blue Pill · micro:bit V2 · Arduino Uno R4 · ESP32 DevKit · ESP32-S3-DevKitC-1 · ESP8266 NodeMCU · Arduino Pro Mini 3.3 V · Seeed XIAO ESP32-C3 · ESP32-C3 SuperMini · Seeed XIAO ESP32-C6 · ESP32-DevKitC V4 · LOLIN32 Lite · Wemos D1 R32 · Cheap Yellow Display · TTGO T-Display · Seeed XIAO ESP32-S3 · Arduino Nano ESP32 · Arduino Nano RP2040 Connect · Seeed XIAO RP2040 · Waveshare RP2040-Zero · Arduino Uno R4 WiFi

## The calls you will use

In the order a sketch meets them.

### GxEPD2_BW<GxEPD2_213_BN, GxEPD2_213_BN::HEIGHT> display(GxEPD2_213_BN(10, 9, 8, 7))

A black and white 2.13 inch panel with its CS, DC, RST and BUSY pins. On an Uno, use a smaller page height to fit the RAM, as the library’s examples do.

### display.init(115200)

Resets the panel and starts SPI. The number is the bit rate for the library’s diagnostic messages on Serial.

### display.setFullWindow()

The next page loop redraws the whole panel with a full refresh, which clears any ghosting.

### display.setPartialWindow(0, 0, 128, 32)

Limits the next page loop to one area and refreshes it without the full flash, for a clock or a value that changes.

### display.firstPage()

Starts the page loop. Put every drawing call inside the do-while that ends on nextPage().

### display.setTextColor(GxEPD_BLACK)

Black text on the white background. GxEPD_WHITE and GxEPD_BLACK are the two colors a black and white panel has.

### display.hibernate()

Powers the panel’s driver down after drawing. The image stays on the glass with no power at all.

## Example: E-paper name badge

On the Arduino Uno R3. It runs in the browser exactly as printed.

sketch.ino · Arduino Uno R3

Open it in the editor, wired and ready to run · E-paper name badge: the project page

## Common errors and how to fix them

### Busy Timeout! on the Serial monitor

The library waited for the BUSY pin and it never changed. Check the BUSY wire and its pin in the constructor, and that the panel class matches your panel, since a wrong class sends commands it ignores.

### A faint copy of the old picture stays behind

That is ghosting from many partial refreshes. Do a full refresh with setFullWindow() every few minutes or every few dozen updates.

### The sketch resets or the picture is cut short on an Uno

A full frame buffer does not fit in 2 KB. Use the page height trick from the GxEPD2 examples (MAX_DISPLAY_BUFFER_SIZE) so the library draws the panel in several bands.

## Projects that use GxEPD2

Built-in projects that include it. Each page has the full sketch and opens in the editor, already wired.

Shelf label A 2.9 inch SSD1680 e-paper price tag driven with GxEPD2: drawn once with a full refresh, marked down with a partial one, and kept with the power off.

## Keep going

### Learn

- Arduino E-Paper Display: GxEPD2 on a 2.9 Inch Panel

### Parts

- E-paper display, SSD1680 2.13 inch
- E-paper display, 2.9 inch

### More displays libraries

- Adafruit SSD1306
- Adafruit GFX Library
- LiquidCrystal I2C
- LiquidCrystal
- LCD_I2C
- hd44780
- TFT_eSPI
- U8g2

Every built-in library · Open the editor

## Try GxEPD2 without installing anything

Open the example, change the sketch, and keep your version in a free account.

Start building free

Open the editor
