Pizza Debounce Doorbell
A hungry kid rings the doorbell ring-ring-ring-ring! Should the kitchen bake four pizzas? Let's teach it to wait until the ringing stops.
π§ Before we start
Rocket Canary Switch taught us to go slowly and safely. Today the computer learns to wait for quiet. This is called debouncing: every new ring restarts the timer, and the job happens only once, after the ringing stops.
Build the calm doorbell program
Tap the blocks in the right order so the kitchen waits for quiet before it bakes.
Ring the bell, then stop!
Tap the bell at least 3 times quickly. Watch the timer restart each time. Then stop and wait.
Pick the right wait
The kid rings at time 0, 2, and 4, then stops. Choose how long the kitchen waits and see what happens.
Wait or act now?
Debouncing is great for noisy repeats. But some events are urgent! Choose for each one.
π What you learned
- Debouncing means waiting until repeated events stop.
- Every new event restarts the timer.
- The job runs once, after the quiet time ends.
- The wait must be longer than the pause between events, but not too long.
- Urgent events like alarms should act now, not wait.