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 Extra

PiperCode Project Extra

Beat the Buzzer


Intermediate

45 Mins

Grades 3 - 8

Look for the graphic above
to launch the project
INTRODUCTION

Fastest reflex wins! Play each other to hit the buzzer and turn on your light first!

In this project, students design a game of skill that they may play against each other. Each player will race to press their button the fastest after the buzzer buzzes and the winner's light will turn on!

These step-by-step instructions in the tutorial guide students through the process of building the circuit and writing the code.

PROJECT MATERIALS

Piper Computer Kit
10 Wires (5 blue, 5 yellow)
2 Buttons
1 Buzzer
2 LEDs (red, blue)
2 Breadboards

PROJECT RESOURCES

Concepts

In this project, students will learn to program functions and procedures, a key skill for programming. Other key skills in this project include timer, sequences and variables.

Troubleshooting Tips

  • Functions are new in this project! Make sure the Studentsstudents understand there are two separate groups of code as you see on the right, which is intentional.
  • The new group of code is a function that performs a specific action(s). This is a common powerful coding technique which reduces the amount of code. Each function has a name. In this example, the name of the function is ‘disp’. We now refer to the first group as the ‘Main’ function. It is distinguished as the main one because it has a Start block. The Main function can ‘run’ other functions.
  • In this example, the dark blue block ‘disp with:lights’ is ‘running or transferring control to the ‘disp’ function and all the code blocks in that function are run. Then the control goes back to the Main function, and the blocks after the blue one are run. In this example it is wait 5000 ms, and then go back to the top of the repeat forever loop.
  • Also notice that a variable is passing information to the function. In this example the variable is named ‘lights’. The value stored in that variable can change and it will in turn change what happens when the code in the disp function is run.
  • The use of functions and passing information with variables are powerful programming skills that are used in many programming languages.

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 Get your stuff!

For this project you will need: 5 blue wires and 5 yellow wires, 2 breadboards, 2 buttons, 2 LEDs, and a buzzer.

Step 2 Plug in the parts 1

Add two wires from pins 37 and 39 to a button. Add two wires from pins 33 and 35 to an LED.

GPIO Setup Button Pins: 37, 39
Blue LED Pins: 33, 35

Step 3 Plug in the parts 2

Add two wires from pins 19 and 21 to an LED. Add two wires from pins 11 and 13 to a button.

GPIO Setup Button Pins: 11, 13
Red LED Pins: 19, 21

Step 4 Plug in the parts 3

Add two wires from pins 3 and 5 to a buzzer. Put the positive side on pin 3.

GPIO Setup Buzzer: 3, 5

Step 5 Start the main game loop

Drag a Repeat Forever block under the Start block.

Step 6 Initialize the pins

Turn off the pins 19 and 33.

Step 7 Give warning

Turn pin 3 on and off twice to warn the players the game is about to begin.

Step 8 Build tension

Wait for a random number between 2000 and 8000. These are in 1/1000ths of a second, so 2000 is 2 seconds.

Step 9 Buzzer!

Turn pin 3 back on to start the race!

Step 10 Start the getWinner function

Add a Repeat Forever block to the getWinner function.

Step 11 Pick a winner

If pin 11 or 37 is on, return player #1 or player #2.

Step 12 Start the 'disp' function

Add an If/Else block inside the disp function to check which player won.

Step 13 urn the winner's LED on

If player #1 won, turn on pin 19. If player #2 won, turn on pin 33.

Step 14 Set the variable for winner

Return to the main game loop and set the variable winner to the result of the getWinner function.

Step 15 Buzzer off!

Turn off pin 3 once a winner has been chosen.

Step 16 Display the winner!

Pass the variable winner into the function disp.

Step 17 Wait to reset

Wait 5 seconds (5000 milliseconds) to reset the game.

Step 18 Play the game!

Challenge someone to a game of Beat the Buzzer!

Completed!