Code Along
Worked examples, then exercises you code yourself and test instantly on a virtual Arduino Uno - right in your browser.
How it works
- Read a worked example and press Run to watch it on the virtual Uno.
- Write your own code in the exercise editor.
- Press Test. The tests run your sketch and tell you exactly what did not match.
- Use a Hint if you are stuck. The model solution unlocks when you pass, or after three tries.
Chapters
Sketch Structure & Serial Output
Write your first sketches: setup() and loop(), messages in the Serial Monitor, an LED you switch on and blink, and reading compiler errors.
Chapter 2Variables & Types
Store values in well-named variables, calculate with them, choose the right Uno type, and see what happens when a number no longer fits.
Chapter 3Operators & Decisions
Compare readings, combine conditions and choose what the sketch does with if, else if and switch.
Chapter 4Loops & Arrays
Repeat work with for and while loops, drive an LED from a loop, store readings in an array and process them - totals, maximums and smoothing.
Chapter 5Functions
Package code into functions with parameters and return values, pass variables by reference, and build formatted text with snprintf.
Chapter 6Time Without delay()
Replace delay() with millis() so several tasks run at once, build a state machine, and write timers that survive millis() rollover.
Chapter 7Digital Outputs, RGB & Buzzer
Drive several LEDs, mix colours on an RGB LED and make sound with tone() - the output half of Lesson 07.
Chapter 8Buttons, Pull-ups & Debounce
Read a push button with INPUT_PULLUP, act on the press rather than the level, and stop contact bounce from counting one press as four.
Chapter 9Analogue Inputs
Read a knob or sensor with analogRead, turn 0-1023 into volts and percent, switch on a threshold without chattering, and average away the noise.
Chapter 10PWM & Fading
Dim an LED with analogWrite, fade it up and down, drive the brightness from a knob, and fade without blocking the sketch.
Chapter 11Motors & the H-Bridge
Drive a DC motor through an H-bridge: direction, PWM speed, stopping safely before you reverse, and a soft start that never blocks the sketch.
How the chapters line up with the lessons
Your saved progress
Code and results are saved in this browser only. Export them to move to another computer or to hand in as evidence.