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.
Your progress stays on this device. Exercises passed on a lab PC do not show on your phone. Use the same device each time, or move your work with Export and Import progress.
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, and pass variables by reference.
Chapter 6Digital Outputs, RGB & Buzzer
Drive several LEDs, mix colours on an RGB LED and make sound with tone() - the output half of Lesson 09.
Chapter 7Buttons, 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 8Time Without delay()
Replace delay() with millis() so several tasks run at once, build a state machine, and write timers that survive millis() rollover.
Chapter 9Finding & Fixing Faults
Start from the symptom, name the fault class, fix one thing and re-test: compile errors, braces, = versus ==, pin modes, wrong pins and a flooded Serial Monitor.
Chapter 10Analogue 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 11PWM & Fading
Dim an LED with analogWrite, fade it up and down, drive the brightness from a knob, and fade without blocking the sketch.
Chapter 12Servos & Position
Attach a servo, send it to an angle, sweep it with a loop, steer it from a knob and a button, and sweep it without blocking the sketch.
Chapter 13Motors & 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.
Chapter 14The I2C LCD Display
Put text on a 16x2 LCD with an I2C backpack: two lines, the cursor, tidy updates that leave no crumbs, and live readings.
Chapter 15Text & Time Formatting
Build fixed-width text with snprintf: times, dates and a live clock on the LCD, and floats with dtostrf because the Uno cannot print %f.
Chapter 16Assessment Practice: Tasks A & B
Rehearse the two assessed practicals in the simulator: a two-button speed selector that reports every change, and a sensor alarm with hysteresis that fails safe when the sensor breaks.
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 the file to your facilitator so they can see what you have passed.