Page 136 · Robotics with the Boe-Bot
you can use these values to calculate how many pulses to send to the servos. This is the
number you will have to use for your
FOR…NEXT loop's EndValue argument.
pulses90
pulses...24.90
s
pulses65.40
s22.2ulsesp
≈
=
×=
The calculations in this example took two steps. First, figure out how long the servos
have to run to make the Boe-Bot travel a certain distance, then figure out how many
pulses it takes to make the servos run for that long. Since you know you have to multiply
by 40.65 to get from run time to pulses, you can reduce this to one step.
s
pulses65.40
speedBotBoe
cetandisBotBoe
ulsesp ×
−
−
=
Example – Time for 20 in
At 9 in/s, your Boe-Bot has to travel for
2.22 s to travel 20 in.
pulses90
pulses...333.90
pulses65.40920
s1
pulses65.40
in 9
s1
in 20
s
pulses65.40
in/s 9
in 20
ulsesp
≈
=
×÷=
××=
×=
Example – Time for 51 cm
At 23 cm/s, your Boe-Bot has to travel for
2.22 s to travel 51 cm.
pulses90
pulses...136.90
pulses65.402351
s1
pulses65.40
cm23
s1
cm15
s
pulses65.40
cm/s 23
cm 51
ulsesp
≈
=
×÷=
××=
×=
Your Turn – Your Boe-Bot’s Distance
Now, it’s time to try this out with distances that you choose.
√ If you have not already done so, use a ruler and the ForwardOneSecond.bs2
program to determine your Boe-Bot’s speed in in/s or cm/s.
√ Decide how far you want your Boe-Bot to travel.
√ Use the pulses equation to figure out how many pulses to deliver to the Boe-
Bot’s servos: