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.
Have an different version? Look for more information on the Support Page.
Troubleshooting Tips
Q: Is the button press not registering?
A: 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.
Q: What does “LOW when pulled UP” mean?
A: 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
Google Teachable Machine
A fast, easy way to create machine learning models for your sites, apps, and more – no expertise or coding required.
The Artificial Intelligence (AI) for K-12 initiative
The initiative is developing national guidelines for AI education for K-12, an online, curated resource Directory to facilitate AI instruction, and a community of practitioners, researchers, resource and tool developers focused on the AI for K-12 audience.
Vocabulary Words
Circuit A conductive path for flow of current or electricity
Power The current or flow of electric charge and voltage
Microcontroller An integrated circuit that contains a microprocessor along with memory and
associated circuits
Loops A sequence of instruction s that is continually repeated until a certain condition is reached
Variables A value that can change, depending on conditions or on information passed to the
program
Input Device A hardware device that sends data to a computer, allowing interaction and control
Output Device A piece of hardware which converts information into a human-perceptible form