top of page

Lesson 3.2

Loops & Sequences
Established Goals

As the second dive into coding, this lesson challenges students to extend understanding to solve problems by coding behaviors in the language of PiperCode.

 

The Stoplight project controls 3 LEDs: Green, Yellow, Red and includes practice changing the sequence of the lights, based on pivoting essential questions about a real life situation, a local intersection stoplight.


Lesson Time: 45 to 60 min

​

Assessment: Summative Assessment 3.2

Learning Objectives
Students Will:

1

Practice breadboarding and wiring

2

Review and understand computational concepts of:

  • loops: running the same sequence multiple times.

  • sequence: identifying a series of steps for a task

3

​

Demonstrate computational thinking core concepts, including:

  • Algorithm Design by creating an ordered series of instructions for solving similar problems or for doing a task, such as turning a light off and on in the right order.

  • Simulation by developing a program to imitate real-world process of a stoplight.

4

Create programs that include events, loops, and conditionals.

5

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

6

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

7

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

Lesson Preparation
​
  • Complete the coding and electronic builds yourself. See Piper Quick Guide: Stoplight Project

  • 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.

OpenGuide_Orange_1a.png
  • 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.

Lorem ipsum Lorem ipsum Lorem ipsum 

Lesson Resources:
SlideDeck_80_1a.png
Vocabulary_80_1a.png
Assessment_80_1a.png
ChainReaction_80_1a.png
ENGAGE

Introduction (5-10 minutes):

  1. Teacher led discussion: Ask “What do you think is going to happen in the Stop Light project?”(helps with engaging student curiosity).

  2. Teacher led discussion: Start a PiperCode Concept map (or Mind Map) to capture student thinking, either on a white/chalk board, or a Poster board, or a shared document, or use a map software tool.

    • Add sections for students to document and share their ideas, key discoveries, activate prior knowledge from Blink, questions, hints, etc. with their classmates as you begin Stop Light.  

    • Suggestions for sections: Class Rules, Bugs, Hints, Electronics, Blocks, Blink, StopLight, (later add Light Show and Frog Frenzy). Seed each section with some reflections from the last session’s closing or your own notes, but be deliberate to use the language and terms of your local students.

  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!) Write that under class rules in the PiperCode Ideas map.

EXPLORE

Main Activity (20-30 minutes):

  1. Encourage students to complete the Stoplight Project steps in their groups.  

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

​

  • How is the sequence more complicated in this project than Blink? (ans: turning more LEDs on and off, each with wait time, we are doing 3 instead of just one).

  • How is this simulating a real-life stoplight? (ans: start with green, go to yellow, rest on red and we changed the wait time between each).

  • How might we adjust the time a light stays on to make your stoplight safer for pedestrians or cyclists? (ans: increase wait time.  Perhaps add a buzzer which beeps during the wait time for red?)

  • EXTENSION: How might we create a two-way stoplight? (ans: add a breadboard with more LEDs and run parallel block code sequences to turn on the pins at the same time - but vary which pins come on so one set has Green on when the other has RED.)

 

* These checks for understanding help reinforce learning of computer science skills such as creating programs that use include loops, sequences; decompose problems into smaller tasks; or incorporate smaller portions of existing programs, to develop something new or add more advanced features. (CA CS 3-5.AP.12 through 14)

EXPLAIN
  1. Review vocabulary words and definitions that were encountered during the lesson, including Pseudocode, sequence, program, event, algorithm.  Have students use their own language to explain these concepts.

  2. Facilitate: Walk the room to each team and observe breadboards and code. Use the pictures in the Stoplight Project Breadboard and Code Solution for review. Quickly verify that the lights are blinking properly. 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.

 

Closing Activity (10-15 minutes):

ELABORATE
  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 or peer led discussion.

  3. Teacher led discussion:  3.2 SLIDES - Loops and Sequences

    • Review major concepts and link to when they learned them while building PiperCode, such as:  How do Loops and Sequences build further on the foundations of computation?

    • Remind students of alternative explanations.

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

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

  • [OPTIONAL]: Have students use Google Draw or the whiteboard to write in Pseudocode the basic logic of the project’s codes.

  • [OPTIONAL]: Have students complete a Quick reflection

  • Have students document the Stoplight project as a project in their Piper Journal to 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 in Appendix)

​

EXTENSION:

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

bottom of page