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.
Chapter 17Temperature & Humidity (DHT11)
Optional practice: read a DHT11, print temperature and humidity, catch failed readings with isnan(), and make a broken sensor switch the alarm on.
Chapter 18Real-Time Clock (DS1307)
Optional practice: read the time from a DS1307, print it as HH:MM:SS and DD/MM/YYYY with snprintf, check the clock is running, and switch an alarm on at a set time.
Chapter 19Switching a Fan (MOSFET Driver)
Optional practice: switch a fan on and off through a MOSFET, set its speed with PWM, give it a soft start, and add a thermostat that does not flicker on and off.
Chapter 20ESP32: First Sketch
Start Serial at the ESP32 speed of 115200 and blink the LED on GPIO 2.
Chapter 21ESP32: LOW, MID or HIGH
Sort 0-4095 readings into LOW, MID and HIGH with if and else.
Chapter 22ESP32: 0-4095 to Percent
Use map() to turn a 0-4095 reading into 0 to 100.
Chapter 23ESP32: A Web Page as Text
Build a web page as a String with page +=, then turn a slider value into a brightness.
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.