Variables
variables, counters, arithmetic
Stage 3 introduces variables — named boxes that store numbers your program can change. You will count, score, time events, and do math, building counters, stopwatches, and even a simple calculator.
Skills you will learn
- Variables with int and storing values
- Increment and decrement with ++ and --
- Counters, stopwatches, and timers
- Random numbers and arithmetic
After Stage 3, your Arduino can keep score, count visitors, and simulate dice rolls — all because it remembers numbers!
10 projects in this stage
21LED Counter
int variable stores a count
22Digital Counter
display a counter value
23Stopwatch
millis() arithmetic for elapsed time
24Countdown Timer
decrement a variable over time
25Score Keeper
increment with ++ and --
26Lap Counter
multiple counter variables
27Visitor Counter
count events from a sensor
28Random Number Generator
random() within a range
29Dice Simulator
variables plus random for dice
30Simple Calculator
arithmetic expressions with variables