Question: Here is the codes you need to modify it as what it ask in the picture: ' -----[ Title ]-------------------------------------------------------------- ' Robotics with the Boe-Bot
Here is the codes you need to modify it as what it ask in the picture:
' -----[ Title ]--------------------------------------------------------------
' Robotics with the Boe-Bot - RoamingWithWhiskers.bs2 ' Boe-Bot uses whiskers to detect objects, and navigates around them.
' {$STAMP BS2} ' Stamp directive. ' {$PBASIC 2.5} ' PBASIC directive. DEBUG "Program Running!" ' -----[ Variables ]----------------------------------------------------------
pulseCount VAR Byte ' FOR...NEXT loop counter. ' -----[ Initialization ]-----------------------------------------------------
FREQOUT 4, 2000, 3000 ' Signal program start/reset.
' -----[ Main Routine ]-------------------------------------------------------
DO
IF (IN5 = 0) AND (IN7 = 0) THEN GOSUB Back_Up GOSUB Turn_Left GOSUB Turn_Left
ELSEIF (IN5 = 0) THEN GOSUB Back_Up GOSUB Turn_Right
ELSEIF (IN7 = 0) THEN GOSUB Back_Up GOSUB Turn_Left
ELSE GOSUB Forward_Pulse
ENDIF LOOP
' Both whiskers detect obstacle ' Back up & U-turn (left twice)
' Left whisker contacts ' Back up & turn right
' Right whisker contacts ' Back up & turn left
' Both whiskers 1, no contacts ' Apply a forward pulse ' and check again
' -----[ Subroutines ]--------------------------------------------------------
Forward_Pulse: PULSOUT 13,850 PULSOUT 12,650 PAUSE 20 RETURN
Turn_Left: FOR pulseCount = 0 TO 20
PULSOUT 13, 650 PULSOUT 12, 650 PAUSE 20
NEXT RETURN
Turn_Right: FOR pulseCount = 0 TO 20
PULSOUT 13, 850 PULSOUT 12, 850
PAUSE 20 NEXT
RETURN
Back_Up: FOR pulseCount = 0 TO 40
PULSOUT 13, 650 PULSOUT 12, 850 PAUSE 20
NEXT
RETURN

Engr 121 Challenge 2 Tactile Navigation Tasks Please program the Boe-Bot to navigate a 4-walled box using tactile sensors. The dimensions of the box are unknown but it is a rectangular box with a 10-inch wide opening in one of the walls similar to the one shown below Wall dimensions are unknown and they are not drawn to scale Opening 10" The Boe-Bot is placed outside of the "box" facing wall A at about 30 angle. It enters the box in a straight forward movement (but at an angle to wall A) until one or both of its whiskers touch the wall A. After that, it must touch each of the other three walls (B, C, and D) at least once, in any order, and be able to find its way out through the same opening. The key is to design an efficient path for the Boe-Bot so it will take the least amount of time to complete the path. Each time the Boe-Bot hits a wall, it should backup a little before it makes a turn and moves forward again. Grading 20 points if the Boe-Bot completes all the requirements in 3 minutes or less. One point is deducted for each additional one minute (or fractions of a minute) the Boe-Bot takes to complete the course. The maximum allowed time per run is 5 minutes. For partial credits, you receive 4 points each time the Boe-Bot touches a different wall and makes a course adjustment (i.e., makes a turn) according to its sensor inputs. Thus, you get 14 points if the Boe-Bot successfully touches all four walls but could not find the exit within 5 minutes (16 points for touching 4 walls and -2 points for 2 extra minutes). The fastest finisher that meets all requirements will receive 2 bonus points. Make sure that you have enough battery power to last the entire course. Servos will not run properly with weak batteries. You can make as many "practice" runs as you wish (within the lab period) but will be allowed only two "official" runs with the higher of the two your official score. You must also submit your final PBASIC code in order to receive credits for the challenge Engr 121 Challenge 2 Tactile Navigation Tasks Please program the Boe-Bot to navigate a 4-walled box using tactile sensors. The dimensions of the box are unknown but it is a rectangular box with a 10-inch wide opening in one of the walls similar to the one shown below Wall dimensions are unknown and they are not drawn to scale Opening 10" The Boe-Bot is placed outside of the "box" facing wall A at about 30 angle. It enters the box in a straight forward movement (but at an angle to wall A) until one or both of its whiskers touch the wall A. After that, it must touch each of the other three walls (B, C, and D) at least once, in any order, and be able to find its way out through the same opening. The key is to design an efficient path for the Boe-Bot so it will take the least amount of time to complete the path. Each time the Boe-Bot hits a wall, it should backup a little before it makes a turn and moves forward again. Grading 20 points if the Boe-Bot completes all the requirements in 3 minutes or less. One point is deducted for each additional one minute (or fractions of a minute) the Boe-Bot takes to complete the course. The maximum allowed time per run is 5 minutes. For partial credits, you receive 4 points each time the Boe-Bot touches a different wall and makes a course adjustment (i.e., makes a turn) according to its sensor inputs. Thus, you get 14 points if the Boe-Bot successfully touches all four walls but could not find the exit within 5 minutes (16 points for touching 4 walls and -2 points for 2 extra minutes). The fastest finisher that meets all requirements will receive 2 bonus points. Make sure that you have enough battery power to last the entire course. Servos will not run properly with weak batteries. You can make as many "practice" runs as you wish (within the lab period) but will be allowed only two "official" runs with the higher of the two your official score. You must also submit your final PBASIC code in order to receive credits for the challenge
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
