Inputs
digitalRead(), if statements
Stage 2 teaches inputs and decisions. Your Arduino can read buttons and switches with digitalRead(), then use if statements to choose what to do. You will build games, timers, and alarms.
Skills you will learn
- Reading inputs with digitalRead()
- Making decisions with if statements
- Buttons, switches, and buzzers
- Games and reaction timers
Stage 2 turns your Arduino from a light show into an interactive gadget that responds to you!
10 projects in this stage
11Push Button LED
digitalRead() reads an input pin
12Push Button Buzzer
if statement branches output
13Security Switch
switch state vs momentary button
14Toggle Button
edge detection and toggle latch
15Reaction Timer
millis() with if conditions
16Quiz Buzzer
multiple inputs and first-wins logic
17Electronic Dice
random() triggered by a button
18Simon Says
sequence compare with input
19Memory Game
game state with if decisions
20Mini Alarm
armed and disarmed if tree