MAX7219 Animation Lab / Stage 2 of 3
Procedural pattern
Generate a time-varying row/column pattern.
Compiled 2026-10-19 (historical) · electrical review required
Download stage 2 PlatformIO projectRead code & run steps ↓
What changes now?
Generate a time-varying row/column pattern.
Expected after hardware review: A deterministic wave-like pattern advances at a chosen frame interval.
Builds on stage 1: Moving diagonal.
What you need
Check availability and exact module markings before starting.
Connections / current hardware gate
Before connecting power. Reuse a reviewed four-module MAX7219 setup. Confirm topology, orientation and power before interpreting an animation fault as a software problem.
- Establish the Message Board baseline first.
- Check module order and the 32×8 coordinate orientation with the initial pattern.
- Leave the electrical-review flag closed until the actual chain and supply are approved.
Conditional connection table and full module facts
Electrical review is incomplete. Conditional references require confirmation; unresolved pins or rails are not wiring instructions. Power off before changing connections.
| From device / pin | To device / pin | Signal / voltage | Connection status and notes |
|---|---|---|---|
Four-module MAX7219 LED matrixDIN | ELEGOO Mega 2560 R3 boardD51 / MOSI | serial data 5 V | Conditional reference Verify IN direction and module labels; regulated module supply/current reviewed separately. |
Four-module MAX7219 LED matrixCLK | ELEGOO Mega 2560 R3 boardD52 / SCK | clock 5 V | Conditional reference Verify IN direction and module labels; regulated module supply/current reviewed separately. |
Four-module MAX7219 LED matrixCS/LOAD | ELEGOO Mega 2560 R3 boardD53 | latch/select 5 V | Conditional reference Verify IN direction and module labels; regulated module supply/current reviewed separately. |
display/peripheralGND | controllerGND | Signal reference 0 V | Conditional reference Unpowered wiring check; use correct common-ground topology and keep high-current panel returns out of thin signal paths. |
display/peripheralVCC | verified supplyPin unresolved | Peripheral power Voltage unresolved | Conditional reference Supply voltage/current unknown at carrier level until reviewed; no assumed 5 V or 3.3 V instruction. |
Access describes the source of a requirement. Check availability, the exact revision and the complete power/driver/harness system before starting. Inventory quantities are expected purchase/BOM quantities, not live stock.
- Four-module MAX7219 LED matrixClub-owned
product family verified · preflight required
- ELEGOO Mega 2560 R3 boardClub-owned
product family verified · preflight required
Use this complete project
Target: megaatmega2560 · Environment: checkpoint2 · Stage branch: DISPLAY_STAGE=2
- Open the complete project. Download the stage ZIP, extract it and open the folder containing
platformio.iniandsrcin VS Code. Keep its supporting headers and libraries together. - Build stage 2. Select
checkpoint2in PlatformIO Project Tasks → General → Build, or use a PlatformIO terminal:
A successful Build compiles the program; it does not upload it or approve electrical connections.pio run -e checkpoint2 - Stop at the hardware gate. The supplied electrical-review flag remains false. Have a qualified reviewer complete the actual module, wiring and power checks before using an approved configuration for hardware operation.
As supplied, Serial at 115200 baud reports
STOP: complete wiring/power review in guide before enabling hardware.and initialization stops.
After electrical review: Upload and Monitor
Only with the actual setup reviewed and the configuration explicitly approved, choose this stage's Upload task. Close any monitor using the board first.
pio run -e checkpoint2 -t uploadOpen the matching Monitor at 115200 baud, then compare the expected result with what actually happens.
pio device monitor -b 115200Record Build, Upload and physical observations separately.
Complete source
The viewer starts at src/main.cpp. Use Source file for the board profile, PlatformIO configuration and supporting code. Keep the complete ZIP together.
workspaces/max7219-animation-lab/src/main.cpp
#include <Arduino.h>
#include <SPI.h>
#include <MD_MAX72xx.h>
#include <DisplayCore.h>
#include "board_profile.h"
constexpr MD_MAX72XX::moduleType_t kTopology=MD_MAX72XX::FC16_HW; // verify orientation fixture
MD_MAX72XX matrix(kTopology,53,4);
bool ready=false;uint32_t lastUpdate=0;
uint8_t cells[256]={},nextCells[256]={};unsigned frame=0;
void setup(){Serial.begin(115200); if(!kElectricalReviewComplete){Serial.println("STOP: complete wiring/power review in guide before enabling hardware.");return;}matrix.begin();matrix.control(MD_MAX72XX::INTENSITY,1);matrix.clear();cells[3*32+2]=cells[3*32+3]=cells[3*32+4]=1;ready=true;}
void loop(){if(!ready)return;uint32_t now=millis();if(!displaylab::elapsed(now,lastUpdate,150))return;lastUpdate=now;matrix.control(MD_MAX72XX::UPDATE,MD_MAX72XX::OFF);matrix.clear();
#if DISPLAY_STAGE == 1
for(uint8_t row=0;row<8;++row)matrix.setPoint(row,(frame+row)%32,true);
#elif DISPLAY_STAGE == 2
for(uint8_t x=0;x<32;++x)matrix.setPoint((x+frame)%8,x,true);
#else
for(uint8_t y=0;y<8;++y)for(uint8_t x=0;x<32;++x)matrix.setPoint(y,x,cells[y*32+x]!=0);
displaylab::lifeStep(cells,nextCells,32,8);memcpy(cells,nextCells,sizeof(cells));
#endif
matrix.control(MD_MAX72XX::UPDATE,MD_MAX72XX::ON);++frame;}
Source integrity · SHA-256
1b59ca020624bb93025f6137293c63b21d224924d7b8e7a74728838ada80ab2fRaw downloads and standalone ZIPs retain the canonical bytes and supporting files. Copy follows the selected Comments setting.
Check the result
A deterministic wave-like pattern advances at a chosen frame interval.
As supplied, the false electrical-review flag prevents this hardware result. After qualified review, record what actually happens; the text above is an expected result, not a bench transcript.
Original verification checklist
- Build the exact selected environment; distinguish dependency resolution from source compilation.
- Observe the stated output and record actual behavior; expected result is not an observed transcript.
- Test the named failure mode before proceeding.
Troubleshooting
Life pattern changes unpredictably
Check old/new separation, bounds and seed. Verify the oscillator with the host-tested lifeStep function.
Pattern tears during drawing
Review batched update use and device topology. Do not call this a true hardware double buffer.
Module boundary jump
Use the diagonal to identify orientation and chain order before changing the algorithm.
Technical explanation / original guide
Read the complete original stage guide
Original source/research wording is preserved. The stage's dated build evidence above supersedes earlier blanket compile-status wording; no physical results are implied.
Build it
Generate a time-varying row/column pattern.
Open workspaces/max7219-animation-lab in VS Code/PlatformIO. Select checkpoint2 and run pio run -e checkpoint2. This is FIRMWARE_SOURCE_AUTHORED with embedded compilation unverified. Review the electrical flag and canonical conditional wiring before any upload.
Understand it
Two 256-byte cell arrays are simulation old/new buffers. Every next cell is computed from the old grid, then the arrays are copied after the complete generation. Updating the old grid in place would let earlier updates affect later cells within the same generation. MD_MAX72XX UPDATE is suspended while drawing and re-enabled at the end to batch display writes; that batching is different from owning two hardware framebuffers.
Expected result and verification
A deterministic wave-like pattern advances at a chosen frame interval.
This is expected after a correct build and electrical review, not a captured bench transcript.
Check the selected source branch and named failure conditions. Record actual build or software output separately from future physical observations.
Likely failures
Life pattern changes unpredictably: Check old/new separation, bounds and seed. Verify the oscillator with the host-tested lifeStep function.
Pattern tears during drawing: Review batched update use and device topology. Do not call this a true hardware double buffer.
Module boundary jump: Use the diagonal to identify orientation and chain order before changing the algorithm.
Build evidence, target and remaining verification
Original status: unverified.
Successful checkpoint2 build recorded 2026-10-19 for megaatmega2560; 43 warnings recorded.
No compile was attempted in this pass under the user's testing limit. Upload and physical bench observation remain untested.
atmelavr@5.1.0 · arduino