[RL27] - Grade 2 - Session 7

Session 7: Looping Movement – Creating an Efficient Robot

Duration: 50-60 minutes
Architect: Muhammad Bilal


Equipment Required:

  • M3D Robotics kit (including M3D Go, its attachments, and necessary connections).
  • Laptops with Scratch pre-installed.
  • Paper and pencils for students to document their discoveries and ideas.
  • Markers or objects to set up paths for robots to follow.

Learning Objectives:

  • Understand how loops make coding more efficient.
  • Program the robot to perform complex movement patterns using loops.
  • Collaborate with peers to design and test different movement patterns.
  • Develop critical thinking and problem-solving skills by refining code.

Resources:

Scratch Code File:
Grade 2 Session 7.sb3 (3.4 MB)


1. Introduction to Loops and Efficiency (10 minutes)

Activity:
Introduce the concept of loops and how they can simplify repetitive coding tasks. Explain that instead of writing the same commands multiple times, loops allow students to repeat actions efficiently.

Teacher’s Role:
Explain the importance of loops in coding, using simple examples students can relate to.

Instructions:
Start with helping them understand the idea of loops and repetitive tasks. You can relate examples to their daily routine so that they can better understand the idea and importance of loops. You may say:

“Think about how many things you repeat every day—brushing your teeth, eating meals, or tying your shoes. Even playing your favorite video game involves repeating certain moves! Our lives are full of loops, and just like us, robots can use loops to repeat actions, like moving forward or turning, without needing new instructions every time."

"Today, we’ll learn how to make our robots repeat tasks using loops, just like in our daily routines.”


2. Programming Basic Loops (15 minutes)

Activity:
Students will program the robot using simple loops to repeat movements like turning left, right, or moving forward. This will help them understand how loops work and how they make repetitive tasks easier. You can recall how they used a loop at the end of their previous session when they wanted to make the robot check for obstacles repeatedly.

Instructions:

  1. Start by showing the 2 basic loop structures in Scratch:

Explain their function and how each would relate to something in their daily routine e.g. things they have to daily every day and things they need to repeat only a few times.

  1. After showing the block and building the intuition, you may show them a simple block code using loops such as “Move_Steps”:

  2. Explain how this code would have the same effect as:

  3. Students might raise a question that why can’t they just use the same “Move_10 Steps” block instead of using loops. You can there show them the capabilities of “Repeat _ Times” loop by repeating multiple tasks using the same structure:

  4. Explain how this code work and how it saves us from repeating tasks. To keep students engaged, you may call this movement a sort of a March that the robot is performing.

  5. Now, encourage them to play around with these blocks and create different movement patterns. You can say:

“Let’s start by programming the robot t o turn in a circle using a loop. We’ll use a ‘Turn Left’ or ‘Turn Right’ block, and we’ll repeat it using a loop.”

  1. Guide students to drag a movement block (e.g., Turn Left) into Scratch and wrap it in a Repeat _ Times loop.

  2. Test Basic Loops:

    • Students will test their code, observing how the robot repeats the movement.
  3. Adjusting the Loop:
    You can encourage them to play around with the number of steps or the type of blocks they use e.g. “Express” block:

Teacher’s Role:
Help students understand the mechanics of loops, ensuring they test and adjust their code to see how loops work in practice.


3. Guided Activity: Programming a Complex Path (20 minutes)

Activity:
Students will work in pairs to program their robots to follow more complex patterns, such as moving in a box or square path. They will combine different movement blocks with loops to achieve these patterns.

Instructions:

  1. Set Up the Path:

You can start by saying:

"Now, let’s create a more interesting pattern! We’ll program the robot to move in a square path using loops.”

  1. Programming the Path:

    • Students will program their robots to move in a box or square path using loops and simple movement blocks.
    • Encourage students to test their code and make adjustments to the timing or the number of repetitions.
  2. Experiment with Patterns:

    • You may say:

“Once your robot can move in a square, what other patterns can you create? Try creating a zigzag, a triangle, or even a spiral using loops.”

  • Allow students to experiment with new patterns by modifying the number of repetitions or combining different movement blocks.

Teacher’s Role:
Guide students through planning their sequences, encouraging them to test and improve their code. Provide assistance with troubleshooting and refining their patterns.


4 Robot Art Creations (10-15 minutes)

Activity:
In this activity, students will collaborate to turn their robot’s movement into artwork. By using loops to repeat certain movements, they can create patterns on paper attached to the floor. Each group will design a unique “robot artwork” by programming their robot to move in loops while holding a marker to draw on the paper.

Instructions:

  1. Set Up the Drawing Area:
    Encourage them to get ready for this drawing activity and take out sheets of paper. Tell them that they are going to turn their robots into artists! Each group will attach a marker to their robot and program it to create a unique drawing by repeating movements with loops.”
  • Provide each group with a large sheet of paper to place on the floor and markers to attach to the robot.
  1. Create the Robot Art:
  • Students will use loops to make their robots move in patterns like circles, squares, or zigzags, creating a drawing as the robot moves.
  • Encourage students to experiment with different loop combinations to create interesting shapes and designs.
  1. Share and Compare:
  • Once the robots have finished drawing, students can share their artwork with the class, explaining how they used loops to create their patterns.

Teacher’s Role:
Help students attach the markers securely and guide them through using loops to create movements. Encourage creativity and experimentation with different patterns and loops.

5. Reflection and Conclusion (5-10 minutes)

Activity:
End the session with a reflection on the use of loops and how they made coding easier. Encourage students to discuss what they found fun or challenging.

Reflection Questions:

  • “What was the most interesting pattern you created with loops?”
  • “How did using loops make coding faster or easier?”
  • “What other patterns do you think you could create with loops?”

Teacher’s Role:
Lead the discussion, helping students reflect on their learning and share their experiences.


Learning Outcome:

By the end of the session, students will understand how loops can simplify repetitive coding tasks and make movement patterns more efficient. They will have created and tested various movement patterns using loops, developing both coding and problem-solving skills.