The document contains 9 questions about controlling a BOE Shield-Bot robot and programming concepts. Question 1 asks about the direction wheels need to turn for the robot to go straight or pivot left. Question 2 describes how both wheels turn clockwise to pivot the robot left. Question 3 discusses how to correct if the robot veers, such as adjusting wheel timing. Question 4 calculates the time needed for the robot to travel a given distance at a set speed. Question 5 explains why a delay is needed when ramping servo speed in a for loop. The remaining questions cover using arrays to store multiple values, for and do-while loops to retrieve array values, switch/case statements to select variables, and appending conditions to do-while loops.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
44 views
Chapter 4 Challenges
The document contains 9 questions about controlling a BOE Shield-Bot robot and programming concepts. Question 1 asks about the direction wheels need to turn for the robot to go straight or pivot left. Question 2 describes how both wheels turn clockwise to pivot the robot left. Question 3 discusses how to correct if the robot veers, such as adjusting wheel timing. Question 4 calculates the time needed for the robot to travel a given distance at a set speed. Question 5 explains why a delay is needed when ramping servo speed in a for loop. The remaining questions cover using arrays to store multiple values, for and do-while loops to retrieve array values, switch/case statements to select variables, and appending conditions to do-while loops.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
The Questions:
1. What direction does the left wheel have to turn to make
the BOE Shield-Bot go forward? What direction does the right wheel have to turn? In order for the car to go straight, the left wheel has to turn left and the right must be turned straight.
2. When the BOE Shield-Bot pivots on one wheel to the
left, what are the wheels doing? What code do you need to make the BOE Shield-Bot pivot left? The wheels are both rotating clockwise to make it go left. Ex: // Turn left in place
servoLeft.writeMicroseconds(1300); // Left wheel clockwise
servoRight.writeMicroseconds(1300); // Right wheel clockwise
3. If your BOE Shield-Bot veers slightly to one side when
you are running a sketch to make it go straight ahead, how do you correct this? What command needs to be adjusted and what kind of adjustment should you make? You have various ways to correct this such as changing the timing of the right and left wheel, changing the timing of the delay of the car, holding the reset button to fix mistakes, etc. 4. If your BOE Shield-Bot travels 11 in/s, how many milliseconds will it take to make it travel 36 inches? It will take 3727 milliseconds to travel 36 inches.
5. Why does a for loop that ramps servo speed need
delay(20) in it? Without the delay, the car would go so far that it would look like the car was in full speed immediately and also the ramping wouldn't be seen.
6. What kind of variable is great for storing multiple values
in lists? Its an array.
7. What kind of loops can you use for retrieving values
from lists? We can use for loops and do-while loops for retrieving values from lists.
8. What statement can you use to select a particular
variable and evaluate it on a case-by- case basis and execute a different code block for each case? The statement we can use to select a particular variable and evaluate it on a case-by- case basis and even execute a different code block for each case is switch/case. 9. What condition can you append to a do-loop? I can use the do{...}loop while(condition) while the sketch is running.