Part 1: Why VS Code + Wokwi for Embedded Learning
Post 1: VS Code + Wokwi for Embedded Learning
Most people use technology. Very few actually control it.
I want to change that. You’re going to learn embedded programming by building something fun. Together, we’ll build ‘Light Chaser’, a classic arcade game where a light bounces back and forth. Time your button press right to hit the centre. Miss and you lose.
Seems easy enough, right? But making it work means nailing the ‘Big Three’ of electronics: timing, inputs, outputs.
Before we wire up our first virtual LED though, we need to sort out your workshop. Most beginners grab basic tools they’ll outgrow in a month. We’re skipping that. Going straight to a professional setup that actual developers use: VS Code and Wokwi. Like learning to drive in a simulator before hitting actual roads. Safer, faster, way more fun when nothing can break.
The Magic Smoke Problem
Here’s how it usually goes when you’re starting out.
Order a microcontroller board online. Wait a week for shipping. Wire something wrong and components let out this thing hobbyists call ‘magic smoke’. They stop working after that. Order replacements, wait another week.
Hardware doesn’t forgive mistakes. Connect power backwards and you’ve got a dead board. Too much current kills the LED. Short two pins and everything dies. I’ve done all of these.
This isn’t about embedded development being hard. It’s about learning it being hard. Professionals screw these things up too, difference is they know why it failed and how to figure it out. Beginners just see smoke and confusion.
Simulators fix this. Mistakes are free. Wire something wrong and you just reset, try again. Want to see what happens when you push 500mA through a pin rated for 20mA? Go for it. The simulated chip won’t die. You learn what would happen without spending £15 on replacements or waiting a week for shipping.
Why Not Just Use the Browser Simulator?
If you’ve looked for Arduino tutorials, you’ve probably seen Wokwi already. Great browser simulator. Build circuits, write code, run everything in your browser. Perfect for quick experiments.
We’re taking it further using VS Code. Not just here to blink LEDs. We’re learning professional embedded development from day one.
The browser’s fine for messing about. VS Code’s where real work happens.
Here’s what you get with VS Code that the browser can’t match:
A real IDE. The browser editor’s fine for basics. VS Code’s different. Autocomplete that actually understands your code. Jump to function definitions with one click. Refactoring tools rename variables across your whole project. Errors show up before you even compile. These aren’t luxuries, this is how people actually write code. Learning with proper tools now means no bad habits to unlearn later.
Version control. Browser projects live in browser storage. Clear your cache, switch computers, crash at the wrong moment and it’s gone. VS Code stores your projects as files on your computer. Stick them in Git repositories, track every change, experiment on branches. How actual software gets developed.
Offline work. Once you’ve installed everything and grabbed dependencies, internet becomes optional. On a train, in a cabin somewhere, wherever. The browser simulator needs connectivity. Your local setup doesn’t.
PlatformIO integration. The Arduino IDE’s alright for getting started but hides too much. PlatformIO’s widely used in the industry for embedded toolchains. Runs inside VS Code, manages libraries, handles different board configs. Scales from hobby projects to professional firmware. You’ll probably face PlatformIO or something like it when you work on real embedded stuff later.
Debugging. This is the big one. Browser simulator runs your code. VS Code extension lets you stop time. Set a breakpoint on any line and when execution hits it, everything freezes. Every variable’s there to inspect. Step through code one line at a time, watch values change. You see exactly what’s happening inside your microcontroller at that moment.
I’ll cover debugging properly later. Here’s what matters now. It changes how you think about code. Problems that’d take hours of print statements take minutes with a debugger.
The Goal of This Series
By the end you’ll have a complete, playable Light Chaser game in simulation. Clean, modular code organised like professional stuff. You’ll understand GPIO, timing, state machines, I2C. Enough to build this on real hardware if you want.
What actually matters though is understanding why things work, not just that they work.
When you see pinMode(13, OUTPUT), you’ll know what’s happening at the register level. When you use millis() for timing, you’ll understand the overflow behaviour and why it doesn’t matter. Read a button and you’ll understand pull-up resistors, active-low logic, switch bounce.
What You’ll Need
A computer before the next post. Windows, Mac, Linux, doesn’t matter. Internet for initial setup and downloading packages. About 2GB of disk space for VS Code, PlatformIO, and Wokwi.
No prior programming experience needed. Knowing variables and loops helps, but I’ll explain as we go. Never programmed before? Just learn C alongside embedded concepts. Plenty of people do it that way.
No hardware needed either. That’s the whole point of Wokwi. Build and test everything in simulation first. Want to build the physical version later? I’ll put a shopping list at the end. Optional though.
Why This Approach Works
Learning embedded programming’s tricky for one reason: too many things at once.
A programming language. How microcontrollers work. Electronics. Reading datasheets. Debugging techniques nothing like web or desktop stuff.
Most tutorials throw all this at you with real hardware. Overwhelming. Something breaks and you don’t know if it’s your code, your wiring, a fried component, or plain not understanding how the chip works.
Simulation strips out the hardware variables. Something doesn’t work and it’s your code or your understanding. Much smaller problem. The debugger shows you exactly what your code’s doing. Makes finding bugs way easier.
Once you’ve got the software side down, adding real hardware’s straightforward. Concepts transfer directly, code’s the same. Just pick up a few practical bits like soldering and reading resistor colours.
A Note on Arduino vs ‘Real Embedded’
Some people think Arduino’s just a toy. They’ll tell you to learn ‘real’ embedded programming with bare-metal register stuff from the start.
They’re not wrong. Arduino hides a lot. That digitalWrite() function you’ll use compiles into code that’s roughly 18-50 times slower than direct register access. For professional work, that matters.
But they’re missing the point about learning.
Arduino’s abstractions let you focus on concepts without drowning in processor-specific details. Once you know what digitalWrite() does, learning how to do it faster with registers becomes straightforward. The other way round doesn’t work. Start with registers and you’re fighting syntax whilst trying to grasp fundamental concepts at the same time. Recipe for giving up.
We’ll peek behind Arduino’s curtain later anyway. You’ll see what those friendly functions actually do. By then you’ll have context for it.
What’s Next
Next post we’re installing VS Code, PlatformIO, and the Wokwi extension. I’ll walk through every step. By the end you’ll have a working setup ready for building embedded stuff.
Post after that? You’ll write your first embedded program.
Then we build the game. See you next time!