Datasheet
Page 110· Applied Robotics with the SumoBot
Figure 3-15 Pulse-Decay Trick Timing
Accounting for Command Execution Times
Figure 3-15 shows the ideal situation, ignoring the amount of time it takes for the BASIC
Stamp 2 to transition from one command to the next. Subtracting 220 from the threshold
variable will make your PULSOUT 6, threshold command delay for the correct amount of
time. Of course, if you subtract 220 from a value that's smaller than 220, your program will
have a negative result, which won't be any good either. That's why it's best to have an
IF...THEN statement check the value of time before subtracting 220
HIGH 10
HIGH 9
PAUSE 1
RCTIME 9, 1, time
threshold = time / 4
IF threshold > 220 THEN ' Account for code overhead
threshold = threshold - 220
ELSE
threshold = 0
ENDIF
You can measure these times with the Parallax USB Oscilloscope. To learn more about the
‘scope and the Understanding Signals student guide, see the #28119 product page at
www.parallax.com.