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

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, 09Passed 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 06Passed 0 / 9
Chapter 5

Functions

Package code into functions with parameters and return values, pass variables by reference, and build formatted text with snprintf.

Lessons 06, 19Passed 0 / 9
Chapter 6

Time Without delay()

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

Lessons 11, 28Passed 0 / 7
Chapter 7

Digital Outputs, RGB & Buzzer

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

Lesson 07Passed 0 / 6
Chapter 8

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 08Passed 0 / 5
Chapter 9

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 10Passed 0 / 6
Chapter 10

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 11Passed 0 / 6
Chapter 11

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 12, 14Passed 0 / 6

How the chapters line up with the lessons

Code Along chapterPractisesExercises
1. Sketch Structure & Serial OutputLesson 03: Arduino IDE 2 & First Upload
Lesson 09: 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 06: Loops, Arrays & Functions9 (1 deeper)
5. FunctionsLesson 06: Loops, Arrays & Functions
Lesson 19: DS1307 RTC & Formatted Text
9 (1 deeper)
6. Time Without delay()Lesson 11: PWM, millis() & State Machines
Lesson 28: Non-Blocking Timing with millis()
7 (1 deeper)
7. Digital Outputs, RGB & BuzzerLesson 07: Digital Outputs, RGB LEDs & Buzzers6 (1 deeper)
8. Buttons, Pull-ups & DebounceLesson 08: Digital Inputs, Pull-Ups & Debouncing5 (1 deeper)
9. Analogue InputsLesson 10: Analogue Inputs, ADC & Voltage Dividers6 (1 deeper)
10. PWM & FadingLesson 11: PWM, millis() & State Machines6 (1 deeper)
11. Motors & the H-BridgeLesson 12: Transistors, MOSFETs & Relays
Lesson 14: DC Motors & H-Bridges
6 (1 deeper)

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.