The BASIC Stamp program shown below will operate the Boe-Bot in a straight line.
ID: 2072986 • Letter: T
Question
The BASIC Stamp program shown below will operate the Boe-Bot in a straight line. For how many seconds will the robot operate? Recall that for each FOR-NEXT loop, the pulse to P13 is 1.7 ms, the pulse to P12 is 1.3 ms, the pause duration is 20 ms, and the software overhead is 1.6 ms.
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "Program Running!"
counter VAR Word
FOR counter = 1 TO 280
PULSOUT 13, 850 ' P13 servo counterclockwise
PULSOUT 12, 650 ' P12 servo clockwise
PAUSE 20
NEXT
END
Explanation / Answer
Answer:
tp1=time taken by P13 = 280*1.7 msec
tp2=time taken by P12= 280*1.3 msec
tp3=time taken by pause= 280*20 msec
tp4=software overhead= 1.6 ms
therefore total time robot will operate= tp1+tp2+tp3+tp4=6441.6 msec =6.4 sec
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.