Lesson plan

Generative art and cellular automata lesson plan

Turn a 16x16 LED panel into a night sea in C++ on an ESP32-C3: the Game of Life, random walks, L-systems, noise, flocking fish and a living light wall.

4 chapters, 7 lessons, about 5 hours, on the ESP32-C3-DevKitM-1. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • Cellular automata and random walks: simple rules, rich results.
  • Plants from rewriting rules and a tide from noise.
  • A school of fish from three rules, and the grid under it all.
  • Everything on one living light wall.

Materials for the whole unit

  • Addressable RGB LEDs
  • ESP32-C3-DevKitM-1
  • Full-size breadboard

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 30 min

Rules and chance

Cellular automata and random walks: simple rules, rich results.

LessonTimeWhat students do
Game of LifeConway's two rules on a 16x16 torus of LEDs: a plankton bloom from five cells, rules as bitmasks, and a fingerprint that notices when the colony settles.40 min
  1. Two rules
  2. The bloom
  3. Check one generation by hand
  4. Spot the end
  5. Change the universe
Random walksPlankton that drift by coin flips, a random number generator in three shifts, fading trails, and 64 invisible walkers that check the square root law of diffusion.50 min
  1. One step at a time
  2. Glowing trails
  3. The square root law
  4. Why the square root
  5. A different sea
  6. A swarm

Materials

  • Addressable RGB LEDs
  • ESP32-C3-DevKitM-1
  • Full-size breadboard

Check for understanding

Each student finishes "Random walks" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A swarm".

Chapter 2. About 1 h 20 min

Growth and texture

Plants from rewriting rules and a tide from noise.

LessonTimeWhat students do
L-systemsKelp from a rewriting rule: a string that grows every generation, and a turtle with a stack that turns its symbols into branches.40 min
  1. Rewrite everything at once
  2. A turtle with a stack
  3. Count by hand
  4. A new rule
  5. One more generation
Noise fieldsValue noise in integer math: a hashed lattice, smoothstep blending and octaves make a drifting bioluminescent tide, measured against plain random static.40 min
  1. Static versus smooth
  2. The tide
  3. No creases
  4. Bigger swells
  5. Octaves

Materials

  • Addressable RGB LEDs
  • ESP32-C3-DevKitM-1
  • Full-size breadboard

Check for understanding

Each student finishes "Noise fields" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Octaves".

Chapter 3. About 1 h 15 min

Swarms and space

A school of fish from three rules, and the grid under it all.

LessonTimeWhat students do
FlockingTwelve fish, three local rules and no leader: separation, alignment and cohesion, and an order number that shows a school appear out of a swarm.35 min
  1. Three rules, no leader
  2. Fish on the panel
  3. Each fish sees only its neighbors
  4. Turn on alignment
Mapping a matrixFrom x and y to a place on one long wire: serpentine rows, the function every lesson has leaned on, and rotation for free.40 min
  1. One strip, folded
  2. Exactly the fish
  3. Map one by hand
  4. Rotate for free
  5. Rewire it straight

Materials

  • Addressable RGB LEDs
  • ESP32-C3-DevKitM-1
  • Full-size breadboard

Check for understanding

Each student finishes "Mapping a matrix" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Rewire it straight".

Chapter 4. About 50 min

Project

Everything on one living light wall.

LessonTimeWhat students do
Project: a living light wallFour scenes from the course on one panel, a plankton bloom, drift, a noise tide and a fish school, played from a playlist you can rearrange and extend.50 min
  1. Four scenes, one wall
  2. It glows
  3. The playlist moves on
  4. A faster show
  5. Your running order
  6. Add your own scene

Materials

  • Addressable RGB LEDs
  • ESP32-C3-DevKitM-1
  • Full-size breadboard

Check for understanding

Each student finishes "Project: a living light wall" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Add your own scene".

Your class

Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.