Neon Realm

Day 3: Trials and Allies – Creating Light Patterns

The Neon Underground

The data streams flicker like dying stars above the abandoned server farms of District 7. In the depths of the Neon Realm, where forgotten circuits hum their electric lullabies, you've discovered something the Corporate overlords thought they'd buried forever: the ancient art of pattern programming.

Your salvaged HERO Board pulses with potential in the dim blue glow of your hideout. Tonight, you're not just learning to blink LEDs. You're mastering the rhythmic heartbeat of rebellion itself. Each LED represents a node in the underground network, each pattern a coded message that only the initiated can read.

The Corporate surveillance drones patrol above, their searchlights cutting through the neon-soaked streets. But down here, in the electrical shadows, you're building something they can't track or trace: a night light that breathes with the pulse of the resistance. Three LEDs, three colors, three chances to prove you understand the language that built this digital dystopia.

Your fingers hover over the breadboard. The copper traces gleam like circuit board constellations. Time to show the Realm what you've learned. Time to make the darkness dance.

What You'll Master Tonight

When you complete this mission, you'll command the fundamental skills that separate the hackers from the wannabes:

You'll wire multiple LEDs to your HERO Board without frying a single component. You'll understand why each connection matters and what happens when electricity flows through your circuit. More importantly, you'll write Python code that controls timing with surgical precision, creating light patterns that dance to your exact specifications.

By dawn, you'll have built a programmable night light that cycles through three different LEDs, each one lighting up for exactly half a second before passing the torch to the next. It's your first taste of sequential programming, and it's the foundation for every complex system the Realm has ever produced.

Understanding Sequential Control

Think about the traffic lights at the intersection outside your window. They don't randomly flash colors like a disco ball. Red stays on for exactly the right amount of time, then yellow gets its turn, then green takes over. Each light knows when to shine and when to step back. This is sequential control, and it runs everything from subway systems to washing machines.

Your night light works the same way. Instead of all three LEDs blinking chaotically, you're programming a sequence. LED 1 gets the spotlight, holds it for half a second, then passes control to LED 2. LED 2 does its thing, then hands off to LED 3. LED 3 finishes its moment, and the whole cycle starts over.

The magic happens in the timing. Too fast, and human eyes can't follow the pattern. Too slow, and it looks broken instead of smooth. Half a second per LED hits the sweet spot where each light gets noticed but the sequence feels fluid.

This concept scales up to control entire buildings. Smart homes dim bedroom lights while brightening kitchen counters. Stadium displays create those massive scrolling advertisements. Factory robots move in precise sequences to avoid crashing into each other. You're learning the fundamental rhythm that keeps the digital world synchronized.

Wiring Your Light Network

Wiring diagram for three LED night light circuit

Each LED needs its own digital pin because you're controlling them independently. Pin 13, 14, and 15 become your command channels.

  1. LED 1: Long leg (positive) connects to Pin 13 through a 220-ohm resistor. Short leg goes to ground.
  2. LED 2: Long leg (positive) connects to Pin 14 through a 220-ohm resistor. Short leg goes to ground.
  3. LED 3: Long leg (positive) connects to Pin 15 through a 220-ohm resistor. Short leg goes to ground.
  4. All three ground connections can share the same ground rail on your breadboard.

The resistors prevent your LEDs from drawing too much current and burning out. Think of them as electrical speed bumps that keep the current flow safe.

Code Walkthrough: Building the Pattern

Step 1: Import the Essential Modules

from machine import Pin
import time

The machine module gives you direct access to your HERO Board's pins. Think of it as your hardware interface toolkit. The time module handles all your delays and timing functions. You'll use these two modules in almost every MicroPython project you build.

Step 2: Initialize Your LED Objects

# Initialize the LEDs
led1 = Pin(13, Pin.OUT)
led2 = Pin(14, Pin.OUT)
led3 = Pin(15, Pin.OUT) # Add more LEDs as needed