Where it all started. Three LEDs, a breadboard, and the moment code first felt like magic.
This is one of the first programs I ever wrote, built years ago while learning to program. Regardless of how simple it is, it remains the program that got me the most excited about learning to code.
Something as simple as making a few LEDs light up made me feel like a modern day Sorcerer, with programming being the magic coming out of my fingers. I felt as if I could not just create worlds but also create new experiences that we never thought were possible. It made me realize that the programming languages we create and use are becoming the way we communicate with the world.
Everything I have built since, from production event pipelines processing tens of millions of events a day to computer vision models identifying endangered reptiles, traces back to this breadboard.
Three LEDs (red, blue, and yellow) light up one after another in a cascade, then switch off the same way. Each full cycle runs slightly faster than the last, accelerating over 20 iterations from a 1 second delay down to nearly instant, then decelerating back to the starting speed. The result is a breathing, wave-like pattern that speeds up and slows down forever.
The whole spell is about 40 lines of C++:
for (int i = 0; i < 20; i++) {
RaiseAllLEDS(t); // red → blue → yellow ON, one at a time
LowerAllLEDS(t); // red → blue → yellow OFF, one at a time
t = t - 50; // 50ms faster each cycle
}- 1x Arduino board with digital pins 48, 50, and 52 (I used an Arduino Mega; on an Uno, remap the pins to 8, 9, 10 or any three digital pins)
- 3x LEDs (red, blue, yellow)
- 3x current-limiting resistors (220Ω works)
- 1x breadboard and jumper wires
Wiring: each LED's anode connects to its digital pin through a resistor, cathodes to ground.
| LED | Pin |
|---|---|
| Red | 48 |
| Blue | 50 |
| Yellow | 52 |
- Open
sketch_aug10a.inoin the Arduino IDE - Wire up the LEDs as above (or change the three pin constants at the top to match your board)
- Select your board and port, then hit Upload
- Feel like a wizard
The rest of the story is on my profile and my playable arcade portfolio.