Instructions

Site: GoLabs
Course: Find the Bug
Book: Instructions
Printed by: Guest user
Date: Saturday, 23 November 2024, 3:31 PM

Description

The programs below do not work as intended. Your job is to find and fix the bug(s).

Bug ONE

Your task is to create a program that tells the GoPiGo to drive in a square. Whenever the GoPiGo turns, it should turn on a blinker as a turn signal.

Look at the program below. If this program is run, what will the robot do? 

Connect to your GoPiGo and recreate the program to check your answer.




ONE: Identify the Bug

What part of the task is not included in the program?

What part of the program needs to be changed?

What part(s) of the task does it not complete?


ONE: Fix the Bug

What can be done to the program to fix the bug(s)? 

Modify the program so that it completes the desired task. 

Program your GoPiGo rover to ensure that your program does complete the task.

What did you add to or change about this program?


Bug TWO

Your task is to create a program using the timer to tell the GoPiGo to drive forward for 30 seconds, turn around, and then repeat that process.

Look at the program below. If this program is run, what will the robot do? 

Connect to your GoPiGo and recreate the program to check your answer.



TWO: Identify the Bug

What part of the task is not included in the program?

What part of the program needs to be changed?

What part(s) of the task does it not complete?


TWO: Fix the Bug

What can be done to the program to fix the bug(s)? 

Modify the program so that it completes the desired task. 

Program your GoPiGo rover to ensure that your program does complete the task.

What did you add to or change about this program?


Bug THREE

Your task is to create a program that uses a random number generator to determine the movement and LED "eye" color on the GoPiGo. If the integer is 5 or less, the LED eyes will turn blue and the GoPiGo will drive forward. If the integer is higher than 5, the GoPiGo will drive backwards and the LED "eyes" will turn red.

Look at the program below. If this program is run, what will the robot do? Connect to your GoPiGo and recreate the program to check your answer.



THREE: Identify the Bug

What part of the task is not included in the program?

What part of the program needs to be changed?

What part(s) of the task does it not complete?


THREE: Fix the Bug

What can be done to the program to fix the bug(s)? 

Modify the program so that it completes the desired task. 

Program your GoPiGo rover to ensure that your program does complete the task.

What did you add to or change about the program?


Bug FOUR

Your task is to control the movement of the GoPiGo using timer values for one minute.

          • If the timer is less than 15 seconds, then the GoPiGo should drive slowly forward without LEDs.
          • If the timer is greater than 15 seconds, the GoPiGo should drive quickly with the LED "eyes" on, and drive left and right.
          • If the timer is over 30 seconds, it should reset.

Look at the program below. If this program is run, what will the robot do? Connect to your GoPiGo and recreate the program to check your answer.



FOUR: Identify the Bug

What part of the task is not included in the program?

What part of the program needs to be changed?

What part(s) of the task does it not complete?


FOUR: Fix the Bug

What can be done to the program to fix the bug(s)? 

Modify the program so that it completes the desired task. 

Program your GoPiGo rover to ensure that your program does complete the task.

What did you add to or change about this program?