Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

MAX7219 Animation Lab / Stage 3 of 3

Game of Life

Compute each generation from an unchanged prior grid.

Compiled 2026-10-19 (historical) · electrical review required

Download stage 3 PlatformIO projectRead code & run steps ↓

What changes now?

Compute each generation from an unchanged prior grid.

Expected after hardware review: A three-cell oscillator alternates orientation in the finite grid.

Builds on stage 2: Procedural pattern.

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 / pinTo device / pinSignal / voltageConnection status and notes
Four-module MAX7219 LED matrix
DIN
ELEGOO Mega 2560 R3 board
D51 / MOSI
serial data
5 V
Conditional reference

Verify IN direction and module labels; regulated module supply/current reviewed separately.

Four-module MAX7219 LED matrix
CLK
ELEGOO Mega 2560 R3 board
D52 / SCK
clock
5 V
Conditional reference

Verify IN direction and module labels; regulated module supply/current reviewed separately.

Four-module MAX7219 LED matrix
CS/LOAD
ELEGOO Mega 2560 R3 board
D53
latch/select
5 V
Conditional reference

Verify IN direction and module labels; regulated module supply/current reviewed separately.

display/peripheral
GND
controller
GND
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/peripheral
VCC
verified supply
Pin 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.

Use this complete project

Target: megaatmega2560 · Environment: checkpoint3 · Stage branch: DISPLAY_STAGE=3

  1. Open the complete project. Download the stage ZIP, extract it and open the folder containing platformio.ini and src in VS Code. Keep its supporting headers and libraries together.
  2. Build stage 3. Select checkpoint3 in PlatformIO Project Tasks → General → Build, or use a PlatformIO terminal:
    pio run -e checkpoint3
    A successful Build compiles the program; it does not upload it or approve electrical connections.
  3. 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 checkpoint3 -t upload

Open the matching Monitor at 115200 baud, then compare the expected result with what actually happens.

pio device monitor -b 115200

Record 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

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-2561b59ca020624bb93025f6137293c63b21d224924d7b8e7a74728838ada80ab2f

Raw downloads and standalone ZIPs retain the canonical bytes and supporting files. Copy follows the selected Comments setting.

Check the result

A three-cell oscillator alternates orientation in the finite grid.

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
  1. Build the exact selected environment; distinguish dependency resolution from source compilation.
  2. Observe the stated output and record actual behavior; expected result is not an observed transcript.
  3. 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

Compute each generation from an unchanged prior grid.

Open workspaces/max7219-animation-lab in VS Code/PlatformIO. Select checkpoint3 and run pio run -e checkpoint3. 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 three-cell oscillator alternates orientation in the finite grid.

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 checkpoint3 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