Parallax Boe-Bot Student Manual page 153

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

NEXT
' Continue forward for 75 pulses.
FOR pulseCount = 1 TO 75
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT
' Ramp down from going forward to a full stop.
FOR pulseCount = 100 TO 1
PULSOUT 13, 750 + pulseCount
PULSOUT 12, 750 - pulseCount
PAUSE 20
NEXT
END
Your Turn
You can also create routines to combine ramping up or down with the other maneuvers.
Here's an example of how to ramp up to full speed going backward instead of forward.
The only difference between this routine and the forward ramping routine is that the
value of
is subtracted from 750 in the
pulseCount
it was added. Likewise,
command, where before it was subtracted.
' Ramp up to full speed going backwards
FOR pulseCount = 1 TO 100
PULSOUT 13, 750 - pulseCount
PULSOUT 12, 750 + pulseCount
PAUSE 20
NEXT
You can also make a routine for ramping into a turn by adding the value of
to 750 in both
PULSOUT
commands, you can ramp into a turn the other direction. Here's an example of
PULSOUT
a quarter turn with ramping. The servos don't get an opportunity to get up to full speed
before they have to slow back down again.
' Stop until reset.
is added to the value of 750 in the
pulseCount
commands. By subtracting
Chapter 4: Boe-Bot Navigation · Page 139
' Loop sends 75 forward pulses.
' 1.7 ms pulse to left servo.
' 1.3 ms pulse to right servo.
' Pause for 20 ms.
' Loop ramps down for 100 pulses.
' Pulse = 1.5 ms + pulseCount.
' Pulse = 1.5 ms - pulseCount.
' Pause for 20 ms.
command, where before
PULSOUT 13
from 750 in both
pulseCount
PULSOUT 12
pulseCount

Advertisement

Table of Contents
loading

Table of Contents