Week 3 ยท Functions, Outputs & Buttons
Session 15: Review: reaction timer
Learning outcomes
- Combine outputs, a button and timing in a small game
- Measure a time interval with millis() and random()
- Test a program against success criteria written first
Kit and components
- RGB LED and buzzer circuit, push button, Uno
Pre-reading about 15 min
Students read these on their phones before class. They are listed on the student Before class page.
Session plan
- 0:0015 minQuiz
Week 3 quiz
- 0:1550 minBuild
Mini-project: reaction timer
After a random wait of 2-5 s the RGB LED turns green and the buzzer beeps. The player presses the button and Serial prints the reaction time in milliseconds. Students write three success criteria before coding and test against them.
- 1:0540 minCode Along
Catch-up or extension
- 1:4515 minDiscuss
Did it meet the criteria?
Checkpoint: ready to move on?
Every student has completed the core exercises of Code Along chapters 5-7 or has an agreed catch-up plan.
Extension for fast finishers
Keep a best time and print a new record when it is beaten.
- Code Along 6.6: Startup chimeDeeperLaptop
- Code Along 7.5: Short press or long press?DeeperLaptop
Catch-up path
Homework and practice
Pre-reading for S16.
Facilitator notes
- Flex session: in a shorter course keep the quiz and Code Along catch-up and fold them into the S16 recap.