Phase 3.3 -Events – Piper


Lesson Time:
45 to 60 minutes



In this lesson, students will complete the Light Show Project, which challenges them to practice key electronic and programming skills by orchestrating cause and effect. Students will learn about conditionals and how to use them in their code to make an event occur.





Data Scientist

Graphic Designer

App Developer

Video Game Developer


The goal of this lesson is for students to refresh their learning of Piper hardware and electronic components and dive into computational tinkering!

Students complete the Light Show Project, in the initial Learn PiperCode cluster, which challenges them to practice key electronic and programming skills by orchestrating cause and effect.



Practice breadboarding and wiring



Understand computational concept of events: one thing causing another thing to happen


Explore computational thinking design practices including experimenting and iterating as well as debugging


Create programs that include events, loops, and conditionals.


Decompose problems into smaller, manageable tasks which may themselves be decomposed.



Create programs by incorporating smaller portions of existing programs, to develop something new or add more advanced features.



Test and debug a program or algorithm to ensure it accomplishes the intended task.



Perform different roles when collaborating with peers during the design, implementation, and review stages of program development.



  • Suggested student to kit ratio is 2:1 up to 3:1. Students are in the same teams as before, or make adjustments as necessary to facilitate good teamwork.

  • Make sure Piper kits are built, connected, functioning, and batteries are charged for the Raspberry Pi and the speaker.

  • Retrieve student team storage boxes with Piper build components.

  • Provide storage devices to teams to hold electronics - such as paper plate or paper cup or plastic box.



Introduction (5 minutes)


  1. Teacher led discussion: Ask students what they think the Light Show project will be about. How will it be different than the Stoplight project?

  2. Teacher led discussion: Revisit the PiperCode Ideas Map.

    • Ask students to add discoveries from the prior project, and address misconceptions.  

    • Tease out the main concepts and design practices or ask students to explain more to the whole group if they are giving just fragments of answers.

  3. Remind students of the rules around troubleshooting on their own or asking a partner, before asking for help from an adult (SAY: ask three before me!)

  4. Remind students of roles to play in teams and that they should be switching roles.


Main Activity (30-40 Minutes)

  1. Encourage students to go through the Light Show Project steps in their groups.  

  2. During this time, roam around the room, asking the essential questions* of this lesson:

    • What is triggering the ‘repeat until’ block to take an action? (ans: the pin is on which means the button is pressed). What action is taken? (ans: the pin for the LED is turned on).

    • How do you know which LED will light up when a particular button is pressed? (ans: the pin being turned on in the repeat block is where the LED is wired to the GPIO)

    • How does nesting one repeat block inside another work? How do you know how many times each sequence of code will happen? (ans: nesting one inside the other ensures that the event occurs on a loop while all other code components simultaneously occur on a loop)

    • Talk me through your code like it’s step-by-step in regular English. What does each code block do?

    • If your code is not working or your lights are not behaving like you want, how do you fix it?

* These checks for understanding help reinforce learning of computer science skills such as creating programs that use include events, while testing and debugging a program or algorithm to ensure it accomplishes the intended task. (CA CS 3-5.AP.12 & 17)


Debrief Activity (15-20 Minutes)

  1. Review vocabulary words and definitions that were encountered during the lesson, especially events, debug, troubleshoot, iterate, condition, loop, sequence, binary, and state. Ask students to explain the terms in their own words.

  2. Go around the room to each team and have students demonstrate their solution. Use the pictures in the Light Show Quick Guide’s breadboard and code solution for review. Ask students to explain what their code is doing and how it relates to the circuit. Provide feedback and praise to each student. If one student in a team is not answering, encourage him/her to provide the answers.


Concept Review (10-15 Minutes)

  1. Students take a picture of their control panel, circuits, and code. After completing projects, students take apart any circuits on separate breadboards and return parts to their proper bag in the storage bin.

  2. Students put kit away to avoid distractions during teacher led discussion.

  3. Teacher led Discussion: 3.3 SLIDES - Events

    • Review major concepts and link to when they learned them while building PiperCode. Ask them to cite examples of their code when describing what they have learned.

    • Remind students of alternative explanations.

    • Refer students to alternative explanations about how the blinking was activated and sequenced. (Celebrate multiple ideas and solutions).

    • Ask students what new ideas should be added to PiperCode Ideas Map


Teacher Led Discussion (5% of Class Time)

Reflection (5 minutes):

  • [OPTIONAL]: Have students add more to the PiperCode Ideas Map.

  • [OPTIONAL]: Have students complete the Quick reflection.

  • Have students document the Light Show as a project in their Piper Journal. Include Pseudocode, their block code, and a sketch of the circuit created. They should note any roadblocks and how they troubleshot solutions, or how they might build it differently the next iteration. Evaluate their Piper Journals and teamwork with a rubric (see sample Grading Rubric)


  • Provide samples of circuit diagram components and circuit diagrams, and have students create circuit diagrams of the projects built in this lesson in their Piper Journal.