Lessons and the learning game

E-paper displays

Use e-paper from an Uno with GxEPD2: how e-ink holds a picture, full and partial refresh, layouts, fonts, sleeping between updates, an ISS pass badge.

Take the course at /learn/path/epaper-displays. It is an intermediate course: it assumes the Uno course.

The lessons

How e-paper works. A lunar base drawn once with a full refresh while BUSY is high, then hibernate, and the picture stays. Then a press counter: partial refreshes of one strip, the ghosts they leave, and a full refresh every fifth update.

Drawing for paper. A mission status card in pure black and white, placed from width() and height() so it survives a rotation. A rocket drawn in pages, because a 4000-byte picture does not fit in 2048 bytes of RAM. A weather card with GFX fonts, getTextBounds() centering and 16x16 icons.

Living on a battery. A sensor node that wakes, draws with a partial refresh and hibernates on a timer, with a power budget that turns into days of battery.

Boss. An ISS pass badge on a 2.9 inch panel: a mission patch from shapes, a countdown updated with partial refreshes and a full one every sixth, a details page on the button, and LOOK UP when the station is overhead.

The benches

Six lessons open the gallery's e-paper name badge: a 2.13 inch SSD1680 panel (250 x 122) on SCL 13, SDA 11, CS 10, DC 9, RES 8 and BUSY 7, powered from 3.3 V, and a button on pin 2. The boss opens the shelf label: the 2.9 inch panel (296 x 128) on the same pins, with the same button.

What each sketch does

  • epdink: one full refresh (or REDRAWS of them), timed, then hibernate().
  • epdrefresh: a counter on the button, partial refreshes of a 250 x 50 window and a full one every FULL_EVERY.
  • epdlayout: a status card with ROTATION and a PROGRESS bar.
  • epdpages: counts the passes of the drawing loop for a MAX_DISPLAY_BUFFER_SIZE page buffer.
  • epdfonts: FreeMonoBold 9 and 18 point, a READING centered with getTextBounds(), and two bitmaps.
  • epdsleep: an update every UPDATE_SECONDS, the time awake and a battery estimate in days.
  • epdboss: the badge, counting down from NEXT_PASS_MIN with one badge minute every TICK_SECONDS.

Honest limits

  • Ghosting and the flashing waveform are taught from real panels. Do not judge how much a real panel ghosts from the simulated one.
  • Refresh times are the simulated controller's plus the Uno's software SPI: a real panel's differ, and get longer in the cold.
  • The Uno never sleeps in these sketches; the battery estimate counts only the time awake, as the sleep lesson explains.
  • The ISS pass times are made up. A real badge would fetch them for your town over Wi-Fi.

Displays: characters, digits and dots, Color TFT screens and touch UI and Low power products.