MISSION OBJECTIVE
Learn to build and code a circuit that can count how many times you press a button.
In this project, students will build a counter using a variable. The counter records how many times a button is pressed. Tally represents a common way that a score is kept in a video game.
View student interface at make.playpiper.comMISSION CHARACTERS
MISSION MATERIALS
Computer with USB port and Chrome or Edge browser
Piper Make Base Station or Starter Kit
MISSION RESOURCES
Learning Goals
- Students will build a tactile button that completes a circuit when pressed.
- Students will use variables and loops to create a program that records the number of times someone pushes the button.
- Students will integrate skills related to knowledge about variables, conditionals, and debugging in the same project.
- Build a button that completes a circuit when pushed
- Use variables and loops to record the number of times I press the button
Learning Activities
ELA Extension: Tally Report Writing
- Pair students up or allow them to work independently based on grade level and writing readiness. Students will collect real-world data using the Tally Counter code and write an informative or persuasive report based on their findings.
- Begin by choosing a question to investigate as a class or individually (e.g., “Which snack is most popular?” or “Do more students prefer cats or dogs?”).
- Students will collect data using the button press tally counter or traditional tally marks. They organize their data into a table or chart.
- Students then write a 1-, 3-, or 5-paragraph report that includes:
- An introduction to the question and its purpose
- A summary and interpretation of the data (e.g., “Out of 20 students, 12 chose pizza.”)
- A reflection on what the results might mean or why they occurred
- (Optional) A persuasive paragraph using the data to support an argument (e.g., “We should serve more pizza because it’s clearly the favorite.”)
Bonus vocabulary words to include: tally, data, input, count, analyze, record
EXTENSION: Create a Data Detectives Wall or digital gallery where students post charts, graphs, and reports alongside visuals or code snippets.
ELD Extension: Partner Tally Survey
- Pair students so that each English Learner (EL) is working with a fluent or higher-level EL.
- Students will begin by practicing simple survey questions with a partner using sentence starters:
- "Do you like ___ or ___?"
- "Which one do you choose?"
- Provide visuals and a scaffolded tally chart for support.
- Each student will then tally answers from 5–10 classmates using the button press counter or paper. They will practice saying their results using complete sentences:
- "I asked 8 students. 5 chose __. 3 chose __."
- Students will retell and present their findings with a partner or small group using sentence frames:
- "Most people chose __."
- "Only __ people chose __."
- "The total was __."
Pairs can create a fun news-style interview using their results.
Example: "Back to you, Pip! 10 students voted for mangoes today!"
Math Extension: Tally, Graph, and Reflect
- Pair students together or assign groups based on class needs.
- Begin by brainstorming survey questions that can be answered with tally data (e.g., "How many people wear glasses?" or "How many smiley faces are in your notebook?"). Assign different groups to different questions to add variety.
- Students collect data using the Tally Counter or tally marks in groups of five. They organize their data in a chart and create a bar graph or line plot to visualize results.
- Students will then calculate and discuss:
- The total count
- The mode (most common response)
- Any patterns or surprising results
- Use class discussion prompts such as:
- "What surprised you about the results?"
- "How would the data change if we surveyed more people?"
- "What’s another way to show this data?"
EXTENSION CHALLENGE:
Turn the lesson into a Math Scavenger Hunt—students tally real-life items around the room or school (e.g., red shirts, high-fives, blue backpacks). Then organize and analyze the collected data as a class.
Career Connections
Software Developer: Salary $127,260/yr
Electrical Engineer: Salary $127,260/yr
Data Scientist: Salary $103,500/yr
Construction Manager: Salary $101,480/yr
Hardware Diagram
Code Diagram
Tutorial Steps
TallyReady? Count us in!
Click NEXT.
A variable stores a value, like the number of button presses. Click the Variables menu to open it, and then click the Create Variable... button. Name your new variable "press count".
Next, we want our count variable to start at zero, so grab a 0 block from the Values menu and place it in the input of the set press count block:
Click NEXT.
Next, drag a wait until block from the Logic menu and place it into the repeat while true block. Do this one more time so that you have two wait until blocks. Then, grab an is pin block from the Chip menu and place it into the input of the wait until block. Change the pin on the is pin block to 7, since that is what our button is connected to. Do this again so that there is an is pin 7 block in both wait until blocks.
Finally, drag the print block from the bottom of your program and place it into the repeat while true block:
Once you've tried out your program, click STOP. Then, click NEXT.
2
3
4
5
Drag out a _ = _ block from the Logic menu and set the condition to chip clock ≤ 10.
Did your program play a sound when you clicked the button 6 times?
Blueprint
OPEN IN BLUEPRINT VIEWER DOWNLOAD
Have an different version? Look for more information on the Support Page.
Troubleshooting Tips
-
Are the console numbers failing to change when you click the button?
- Ensure that your code includes the line to add 1 to the number you have in the console.
- Ensure that you’ve plugged the wires into the right GPIO. Look at the Digital View to see which pin you’re affecting.
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.
Standards Alignment

