Practise by writing code

Code Along

Worked examples, then exercises you code yourself and test instantly on a virtual Arduino Uno - right in your browser.

Your progress 0 of 108 exercises passed

How it works

  1. Read a worked example and press Run to watch it on the virtual Uno.
  2. Write your own code in the exercise editor.
  3. Press Test. The tests run your sketch and tell you exactly what did not match.
  4. 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

Chapter 1

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.

Lessons 03, 06Passed 0 / 8
Chapter 2

Variables & 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.

Lesson 04Passed 0 / 9
Chapter 3

Operators & Decisions

Compare readings, combine conditions and choose what the sketch does with if, else if and switch.

Lesson 05Passed 0 / 8
Chapter 4

Loops & 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.

Lesson 07Passed 0 / 9
Chapter 5

Functions

Package code into functions with parameters and return values, and pass variables by reference.

Lesson 08Passed 0 / 6
Chapter 6

Digital Outputs, RGB & Buzzer

Drive several LEDs, mix colours on an RGB LED and make sound with tone() - the output half of Lesson 09.

Lesson 09Passed 0 / 6
Chapter 7

Buttons, 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.

Lesson 10Passed 0 / 5
Chapter 8

Time Without delay()

Replace delay() with millis() so several tasks run at once, build a state machine, and write timers that survive millis() rollover.

Lesson 11Passed 0 / 7
Chapter 9

Finding & 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.

Lesson 13Passed 0 / 7
Chapter 10

Analogue 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.

Lesson 14Passed 0 / 6
Chapter 11

PWM & Fading

Dim an LED with analogWrite, fade it up and down, drive the brightness from a knob, and fade without blocking the sketch.

Lesson 15Passed 0 / 6
Chapter 12

Servos & 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.

Lesson 17Passed 0 / 6
Chapter 13

Motors & 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.

Lessons 16, 18Passed 0 / 6
Chapter 14

The 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.

Lesson 20Passed 0 / 6
Chapter 15

Text & 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.

Lessons 20, 26Passed 0 / 5
Chapter 16

Assessment 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.

Lessons 15, 24Passed 0 / 8

How the chapters line up with the lessons

Code Along chapterPractisesExercises
1. Sketch Structure & Serial OutputLesson 03: Arduino IDE 2 & First Upload
Lesson 06: UART Serial & Debugging
8 (1 deeper)
2. Variables & TypesLesson 04: Sketch Structure, Variables & Types9 (2 deeper)
3. Operators & DecisionsLesson 05: Operators & Decisions8 (1 deeper)
4. Loops & ArraysLesson 07: Loops & Arrays9 (1 deeper)
5. FunctionsLesson 08: Functions: Naming & Reusing Tasks6 (2 deeper)
6. Digital Outputs, RGB & BuzzerLesson 09: Digital Outputs, RGB LEDs & Buzzers6 (1 deeper)
7. Buttons, Pull-ups & DebounceLesson 10: Digital Inputs, Pull-Ups & Debouncing5 (1 deeper)
8. Time Without delay()Lesson 11: Non-Blocking Timing & State Machines7 (1 deeper)
9. Finding & Fixing FaultsLesson 13: Practical Fault-Finding & Multimeter Skills7 (1 deeper)
10. Analogue InputsLesson 14: Analogue Inputs, ADC & Voltage Dividers6 (1 deeper)
11. PWM & FadingLesson 15: PWM Output & Duty Cycle6 (1 deeper)
12. Servos & PositionLesson 17: Servo Motors6 (1 deeper)
13. Motors & the H-BridgeLesson 16: Driving Loads: Transistors, MOSFETs & Relays
Lesson 18: DC Motors & H-Bridges
6 (1 deeper)
14. The I2C LCD DisplayLesson 20: I2C, Address Scanning & I2C LCD6 (1 deeper)
15. Text & Time FormattingLesson 20: I2C, Address Scanning & I2C LCD
Lesson 26: DS1307 RTC & Formatted Text
5 (1 deeper)
16. Assessment Practice: Tasks A & BLesson 15: PWM Output & Duty Cycle
Lesson 24: Thermistors, the Beta Equation & Calibration
8 (2 deeper)

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.