DEBUGGING

Investigate what's wrong with these Phiro Unplugged or Phiro Pro programs and find a solution for each of the three debug challenges.

Objective

By the end of this lesson, learners will:

  • Investigate the problem and find a solution to 3 debugging challenges
  • Understand computational concepts through testing and debugging
  • Create strategies to test & debug problems
Subjects

Swish Card, Scratch, Steam, Robotics, Coding, Debug, Snap

Age

All Ages

Duration

30 min

Robot & Accessories Needed

Phiro Unplugged or Phiro Pro robot Swish Cards

Software

Get Scratch/Snap for Phiro

  • step1
  • step2
  • step3
STEP 1

Challenge 1 :Debug Phiro Unplugged with Swish Cards

When these Swish Cards are swiped, Phiro is supposed to repeat these steps twice: move forward, flash red light, play Do Re Mi, and turn right. But Phiro only repeats twice: move forward, flash red light, and play Do Re Mi. Can you help find the problem and fix it?

STEP 2

Challenge 2 : Debug Phiro Pro using Scratch (Easy)

In this Scratch program, when the green flag is clicked, Phiro is supposed to Move Forward, Backward, Turn Left, Flash LED Red and Stop. But, when the green flag is clicked, Phiro only does Move Forward, Move Backward, Turn Right, Flash LED Red and Stops.

Where's the bug and how do we fix it?

STEP 3

Challenge 3 : Debug Phiro Pro using Scratch (Intermediate)

For this challenge, get your paper and black marker ready. Draw 1 inch thick black lines, 15cm apart. When ready to start the code, place Phiro at the beginning of the paper to drive across it.

In this Scratch program, when the green flag is clicked, If Phiro detects any obstacle in the front, it should Move forward and stop and turn left for 1 sec and move forward again. And, if Phiro detects a black line, it should Move forward and stop.

But, when the green flag is clicked, When Phiro detects an obstacle in the front, it Moves forward and stops and move backward and moves forward again. And, when Phiro detects a black line, it Moves forward and doesn't stop!

How do we solve this problem?