NEXT
END
You can also think about the distance you just recorded as your Boe-Bot's speed, in units
per second. Let's say that your Boe-Bot traveled 9 in (23 cm). Since it took one second
for your Boe-Bot to travel that far, it means your Boe-Bot travels at around 9 in/s (23
cm/s). Now, you can figure out how many seconds your Boe-Bot has to travel to go a
particular distance.
Inches and centimeters per second – The abbreviation for inches is in, and the
abbreviation for centimeters is cm. Likewise, inches per second is abbreviated in/s, and
centimeters per second is abbreviated cm/s. Both are convenient speed measurements for
the Boe-Bot.
There are 2.54 cm in 1 in.
multiplying the number of inches by 2.54. You can convert centimeters to inches by dividing
the number of centimeters by 2.54.
Example – Time for 20 in
At 9 in/s, your Boe-Bot has to travel for
2.22 s to travel 20 in.
20
in
=
time
9
in/s
s 1
=
×
20
in
9
in
=
. 2
22
s
In Chapter 2, Activity #6, we learned that it takes 24.6 ms (0.024 s) each time the two
servo
and one
PULSOUT
reciprocal of this value is the number of pulses per second that the loop transmits to each
servo. A reciprocal is when you swap a fraction's numerator and denominator. Another
way to take a reciprocal is to divide a number or fraction into the number one. In other
words, 1 ÷ 0.024 s/pulse = 40.65 pulses/s.
Since you know the amount of time you want your Boe-Bot to move forward (2.22 s) and
the number of pulses the BASIC Stamp sends to the servos each second (40.65 pulses/s),
You can convert inches to centimeters by
Example – Time for 51 cm
At 23 cm/s, your Boe-Bot has to travel for
2.22 s to travel 51 cm.
time
commands are executed in a
PAUSE
Chapter 4: Boe-Bot Navigation · Page 135
51
cm
=
23
cm/s
s 1
=
×
1 5
cm
23
cm
=
. 2
22
s
FOR...NEXT
loop. The
Need help?
Do you have a question about the Boe-Bot and is the answer not in the manual?