Lessons and the learning game

Build a scrolling LED sign

Four chained LED matrices driven bit by bit, a font made of bytes, smooth scrolling, typed messages, automatic brightness and a sign for the studio door.

What you build

A 32 by 8 LED sign that scrolls whatever you type, dims itself at night, and shows a steady ON AIR at the press of a button. The firmware drives the display chips by hand, with no display library, so every bit on the wire is one you wrote.

How it works

A daisy chain. Each MAX7219 has a 16-bit shift register, and bits pass from one chip's DOUT to the next one's DIN. The Uno shifts four 16-bit packets and raises CS, and each chip keeps the packet it holds: the first one sent lands in the far module. A No-Op packet, register 0, lets one module change while the others stay put.

Rows of bytes. Registers 1 to 8 are a matrix's eight rows, one bit per LED. The sketch keeps the panel as 32 column bytes and turns them into rows as it sends them.

A font of bytes. Each character is five columns of seven pixels: five bytes, bit 0 at the top. Space to Z is 59 characters, 295 bytes, kept in flash.

A strip and a window. A message becomes one long strip of columns, 32 blank ones and then six per character. Scrolling slides a 32-column window along it, one column every few tens of milliseconds, timed with millis().

Messages from anywhere. Typed text is gathered until Enter and swapped in at the end of a pass. On an ESP32 a web form's handler does the same two things, so the same code takes messages over WiFi.

Brightness that follows the room. Eight light readings are averaged and mapped to the chip's sixteen brightness steps.

The course

Build a scrolling LED sign has six lessons, all on the same wiring:

  1. Chained matrices: wake four chips, a display test and No-Op packets.
  2. Fonts: a 5x7 font as bytes, shown as hex and as pictures.
  3. Scrolling: a column strip, a moving window and a speed control.
  4. Messages: typed messages, swapped in cleanly, tidied and limited.
  5. Brightness: a light sensor, smoothing and sixteen steps.
  6. Project: an on-air sign: messages, auto brightness and a steady ON AIR.

Every step is checked against the running circuit, apart from the last, where you make the sign your own and share it.