Build and code a game that will test your reflexes.
Can you beat the Wheldon Brothers? Or better yet, can you beat a fellow student? In this mission, students will build and code an LED to light up at a random time and then determine who can press their button the fastest.
Students will build a head-to-head game of skill and code a script to select a winner based on who hits their button fastest when a light comes on.
Students will understand how random values can be assigned to a variable.
Students will play the game with a friend to test who has the fastest reflexes.
I WILL BE ABLE TO...
Build circuits with two buttons and a light
Code a game to race my friend to press our button the fastest when the light turns on
Understand how random values are assigned to variables
Learning Activities
ELA Extension: Reaction Race Feature Article
Pair students together or allow them to work independently, based on writing level and project goals. Each student will write an engaging feature article that recounts a high-stakes reaction-time tournament using vivid language, dialogue, and comparisons.
Begin by setting the stage: Explain that the class is hosting the Interplanetary Reaction Race Rally, where robots and humans compete for the fastest reaction time in the galaxy.
Have students test the Reaction Game three times, recording both their own scores and a classmate’s. Encourage them to take notes like a journalist—observe, compare, and look for standout moments.
Students will then write a feature article that includes:
A headline and byline
A lead paragraph with a compelling hook (e.g., “Who won? By how much?”)
Quotes from competitors or coaches (e.g., Pip, Piperbot, or friendly aliens)
Vivid comparisons (“0.28 s—quicker than a lightning flash on Mars!”)
Cause-and-effect phrases (“Because the loop reset too late, the defending champ missed the button.”)
Once drafts are complete, partners will trade articles and provide feedback on clarity, vocabulary, and flow. Final articles can be published or shared with the class.
EXTENSION CHALLENGE: Invite students to design a magazine-style layout, including infographics or leaderboards showing top reaction times.
Bonus points for accurately using vocabulary words: input, loop, variable, random, output, reaction time
ELD Extension: Reaction Time Responses
Pair students up so that one English Learner (EL) works with one other student who is a non-EL or a higher-level EL.
They will start by observing a quick action (e.g., a blinking light, a clap, or a button press) and respond verbally using a full sentence to describe what happened. Examples: “The robot pressed the button when the light turned on.” or “I reacted fast because the signal blinked.”
Partners will then take turns giving each other reaction challenges (e.g., raising a hand or blinking a light) while the other partner responds and describes their action aloud using a sentence frame.
After practicing both roles, students will reflect on their experience by retelling what happened, including whether their reaction was fast or slow and why. Encourage use of comparative and cause-effect phrases such as:
“My reaction was faster than my partner’s.”
“Because I hesitated, I was slower.”
Students will then perform a short skit or demonstration of one of their reaction scenarios, narrating it using their sentence frames. Optionally, recordings of the performances can be used for peer or self-assessment.
Bonus vocabulary words to include: reaction, signal, respond, fast, slow, button, light, time, compare.
Math Extension: Reaction Time Data
Pair students together or allow them to work independently based on math level.
Each student will begin by playing the Reaction Game five times and recording their reaction times in milliseconds.
Students will organize their data in a table, then create a visual representation such as a line plot or bar chart showing their five recorded times.
Using their data, students will calculate the mean, median, minimum, maximum, and range. Then, compare their results with a partner or group to identify trends such as consistency or variability in reaction time.
As a class, discuss the following questions to build interpretation skills:
“What does a lower mean tell us?”
“Who had the greatest variability?”
For an extension, students will convert their fastest time to seconds by dividing by 1000. Then, use the class average reaction time to predict how many rounds could be completed in one minute.
Have an different version? Look for more information on the Support Page.
Troubleshooting Tips
Is the button press not registering?
Look at the Digital View when you press the button while the code runs. If you see no change, push the button into the breadboard forcefully (but carefully) to make sure the leads connect with the rails on the breadboard.
Look at the Digital View when you press the button while the code runs. If you see no change, push the button into the breadboard forcefully (but carefully) to make sure the leads connect with the rails on the breadboard.
What does “LOW when pulled UP” mean?
This generally refers to pull-up or pull-down resistor circuits. In this case, this allows the signal to be rounded UP to the binary TRUE when the button is pushed, and the circuit is complete.
Our customer support specialists are on hand to ensure your implementation of Piper runs seamlessly. View Support Docs or Contact Support
EXPANDED RESOURCES
Term Glossary
Circuit A conductive path for the flow of current or electricity.
Power The current or flow of electric charge and voltage.
Microcontroller An integrated circuit containing a microprocessor with memory and associated circuits.
Variables A value that can change depending on conditions or information passed to the program. A storage location with a symbolic name used to keep track of a value that can change while a program is running (similar concept to using X and Y in an algebraic equation). Variables are not only numbers; they can also hold text, including whole sentences (strings) or logical values (true or false).
Input Device A hardware device that sends data to a computer, allowing interaction and control.
Output Device A piece of hardware that converts information into a form humans can sense and understand.