Close menu

Resources


PIPER COMPUTER

Everything you need to teach STEAM effectivly using the Piper Computer Kit.

Educator Guides StoryMode Project Guides PiperCode Project Guides
PIPER MAKE

Teach fundamental STEM skills while providing a bridge to career connected learning.

Educator Guides
Best Practices Standards Glossary FAQ Educator Forum

EDUCATOR PORTAL

Close menu

ALL GUIDES


StoryMode

  1. Mars
  2. Cheeseteroid
  3. Treasure Hunt
  4. Chain Reaction
  5. Power Plant
  6. Rainbow Bridge
  7. Funky Fungi
  8. Breadboard Bluffs
  9. Return to the Cheeseteroid

  1. Pip Hop
  2. Bot Builder

  1. Ring Race
  2. Snake Trap
  3. Dark Maze
  4. Explosive Escape
  5. Chest Quest

PiperCode

  1. Blink
  2. Stop Light
  3. Light Show
  4. Tally
  5. Siren
  6. Circuit Design
  7. Debug
  8. Frog Frenzy

  1. Color Coded
  2. Ther-Mood-Stat
  3. Security Zone

  1. Randomizer
  2. El Pangolin (Simon)
  3. Beat the Buzzer
  4. 5-Button Synthesizer

PIPER COMPUTER

PROJECT GUIDES


YOU ARE HERE

PiperCode

Project 4 of 8

PiperCode Project 4 of 11

Tally


Beginner

30 Mins

Grades 3 - 8

Look for the graphic above
to launch the project
INTRODUCTION

Count me in! Learn to make a tally machine in this project

In this project students build a counter with a variable. The counter records how many times a button is pressed. When it has been pressed 6 times they are rewarded with a sound. The step-by-step instructions in the tutorial guide students through the process of building the circuit and writing the code.

Tally demonstrates a common way of keeping score in a game. Additional code may be added (borrow from other projects) to make it an interactive game. Advanced students may even add additional wires and another push button.

PROJECT MATERIALS

Piper Computer Kit
Push Button
2 Wires (red, blue)

PROJECT RESOURCES

Concepts

Students use a variable to count button presses and will print the results in the Blockly console. Tally represents a significant step forward in programming complexity in that it involves skills related to variables, conditionals, debugging, and sounds in the same project.

Troubleshooting Tips

  • Students may not understand how to use or access the virtual keyboard when the user clicks into the light green area of the variable a virtual keyboard will appear they must click each key to type a value into the box note teachers can plug a USB Keyboard into piper for your own workstation and it will work.)
  • The print block and displaying values using the console are introduced as a way to debug code this is a tool that students can use at any point in the future code when they are having difficulty with code that is using variables the print block may slow down the code and may need to be reviewed removed to play a game.
  • Students may have difficulty locating some of the code blocks here are the groups:
    • the set blocks is in variables
    • the 0 value is in variables the print block is in chips
    • the if block is in logic the change block is in variables
    • the button press block is in variables
    • the play and synth blocks are in sounds
  • When creating the variable put no spaces in the name or the variable will not work (i.e. "buttonpress" not "button pressed").
  • The code uses a variable (buttonpress) as a counter to track how many times the button has been pressed. The variable is set to 0 before the repeat forever loop. One is added each time through the loop with the code (change buttonpress by 1). Then it is checked for the value (If buttonpress=6) and a sound is played when that equates to be true.
  • The print block is used to see the current value of the variable each time it goes through the loop. This use of variables is a powerful programming technique that is used frequently in all kinds of professional applications it is important that students understand it.
  • Students may mistake the "_" block for the 0 block. Both allow a number to be typed in. But the 0 block is a numeric value while the "_" is a string value. Numeric values can be used in math comparisons, but string values cannot.

Our customer support specialists are on hand to ensure your implementation of Piper runs seamlessly.
View Support Docs or Contact Support
PROJECT STEPS

Step 1 Plug in a button

We will make a button counter. Build this button.

Step 2 Make a variable

A variable stores a value, like the number of button presses. Create a new one named buttonPress.

Step 3 Set to 0

We want our button count to start at 0. Use the Set block and the 0 value.

Step 4 Printing a variable

The console will show us our variable value. To prepare, add this code.

Step 5 Using the console

Turn on the console in the settings, then press Start. You see the variable value printed.

Step 6 Use the button

Use an If block to only print the variable when you press the button. Try it. Press Start, then the button.

Step 7 Now add one

Now use the change 'buttonPress' by 1 block to add 1 every time you press the button. Try it in the console.

Step 8 Magic number 6

Add the following code to play a sound when the variable is 6.

Completed!