Mission Brief: The Speed of Thought
The neural networks of Sector 7 are failing. Deep in the Neon Realm's digital underground, response times are stretching into eternity. What once processed commands in microseconds now lags like syrup in winter. The data streams that keep this sector alive depend on lightning-fast reflexes, and yours might be the key to fixing the cascade failure.
Your HERO Board sits before you, its circuits humming with potential. Two LEDs flicker in the dim light of your workstation, casting electric shadows on the walls. Two buttons wait for your touch. This isn't just another programming exercise. This is a test of human versus machine, flesh versus silicon, instinct versus code.
The Realm's diagnostic systems need a baseline. How fast can human reflexes respond to digital signals? Can organic neural pathways compete with electronic ones? As data packets race through fiber optic veins at the speed of light, your task is clear: build a reaction time tester that measures the gap between stimulus and response.
The setup seems simple. Press a button, light an LED. But beneath this simplicity lies a fundamental truth about the digital realm: everything is input, processing, and output. Every keystroke, every click, every swipe on a screen follows this same pattern. Your fingers hover over the buttons. The LEDs stare back like electronic eyes. Time itself becomes the variable you're trying to measure.
What You'll Learn
When you finish this mission, you'll be able to:
Read button presses in real-time and respond instantly with LED feedback. You'll understand how digital inputs connect to digital outputs, creating the basic feedback loop that powers everything from gaming controllers to spacecraft navigation systems.
Control multiple LEDs independently based on different button inputs. This parallel processing approach mirrors how modern computers handle thousands of simultaneous inputs without missing a beat.
Build interactive systems that respond to human input with machine precision. The foundation skills you'll develop here scale up to user interfaces, robot controls, and any system where humans and computers need to communicate in real-time.
Understanding Input and Output
Think about playing a video game. You press a button on your controller, and instantly something happens on screen. A character jumps, a weapon fires, a door opens. This seems magical, but it's actually a fundamental pattern that runs the entire digital world: input, processing, output.
Your brain works the same way. You see a red light while driving (input), your brain processes "danger, stop" (processing), and your foot moves to the brake pedal (output). The reaction time between seeing the light and hitting the brakes can mean the difference between safety and disaster.
In the digital realm, buttons are input devices and LEDs are output devices. When you press a button, you're sending an electrical signal to the microcontroller. The controller reads this signal, processes it according to your program, then sends commands to the LEDs. The entire cycle happens in milliseconds, but those milliseconds matter.
What makes this powerful is the consistency. Unlike human reflexes that get tired, distracted, or slow with age, microcontrollers respond the same way every single time. They don't have bad days. They don't get sleepy after lunch. They process inputs and generate outputs with machine precision, which is exactly what critical systems need.
Wiring Your Reaction Tester

This wiring creates two independent input-output pairs. Each button controls its own LED, like having two separate reaction testers running in parallel.
- Connect LED 1's long leg to pin 16, short leg to ground through a 220Ω resistor
- Connect LED 2's long leg to pin 17, short leg to ground through a 220Ω resistor
- Connect Button 1 between pin 18 and 3.3V, with a 10kΩ pull-down resistor to ground
- Connect Button 2 between pin 19 and 3.3V, with a 10kΩ pull-down resistor to ground
The pull-down resistors ensure clean digital signals. Without them, your buttons would send noisy, unreliable data that could trigger false reactions.
Setting Up Your Digital Inputs and Outputs
Import the Machine Module
from machine import Pin
import timeThese imports give you access to the microcontroller's physical pins and time functions. The machine module is your gateway to the hardware world, while time lets you control program execution speed.
Initialize Your LEDs as Outputs
led1 = Pin(16, Pin.OUT)
led2 = Pin(17, Pin.OUT)