PROJECT MATERIALS
Piper Computer Kit
3 Buttons (red, yellow, green)
3 LEDs (red, yellow, green)
12 Wires (4 red, 4 yellow, 4 green)
Breadboard
PROJECT RESOURCES
Concepts
In Blink and Stoplight students learned how to program an event output in the form of an LED.
With Lightshow, they will now check the state (or status) of inputs (buttons) to control outputs (LEDs). When a button is pressed (ON), the corresponding color of LED is turned ON so it lights up.
Troubleshooting Tips
- Similar to Blink and Stoplight students can often make mistakes on pin numbers and setting them on or off check to make sure that the pins in the code solution match the color of LED they are trying to light at the different times with their buttons.
- Students must hold down the button to see the LED's turn on because the code is immediately turning the LED's off when they release the button
- Nesting the blocks can be challenging for some it is important that the blocks are inside the repeat code loops make sure students understand the concept of nested loops by having them walk through the code and explain how many times each repeat will happen.
- This is a great project to introduce how to duplicate blocks. After creating the first block that repeats (Step 5) students can right click and select Duplicate.
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!
Take out the inventory you see in the picture below.
Step 2 Wire your LED's and Controller
Wire your LED's and Buttons with the correct GPIO setup. That's a lot of wires!
GPIO Setup
Red LED Pins: 39, 37
Yellow LED Pins: 35, 33
Green LED Pins: 31, 29
Red Button Pins: 26, 24
Yellow Button Pins: 22, 20
Green Button Pins: 18, 16
Step 3 Start programming!
Drag blocks to match the image. The While block is a new one!
Step 4 While block
Program the While block by adding a check for pin 24 (the red button) being ON.
Step 5 Turn the light on
Now program the While block to turn on pin 37 (the red LED).
Step 6 Turn the light off
When we release the button, we want the light to turn off. Add a block to turn pin 37 off.
Step 7 The other lights
Now repeat the pattern for the other two lights.
Completed!