Parallax Boe-Bot Assembly page 34

Mini-sumo robotics assembly documentation and programming
Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

Page 24 · SumoBot – Mini Sumo Robotics
After the QTI is activated, the capacitor is discharged by bringing the R line high and
holding it for about one millisecond. RCTIME is then used to measure the time required
to charge the capacitor to a specified level. This timing will be controlled by the current
flow through the phototransistor side of the QRD1114.
field, the phototransistor current flow will be very low so the capacitor will take a long
time to charge, hence RCTIME will return a large value. When the QTI is positioned over
the white border line, the current flow through the phototransistor is high, so the capacitor
charge time is fast and RCTIME returns a small value.
Load and run program 3.1 to test and evaluate the QTI sensors.
' SumoBot_3.1_Line_Sensor_Test.BS2
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ I/O Definitions ]-------------------------------------------------
LLinePwr
PIN
LLineIn
PIN
RLinePwr
PIN
RLineIn
PIN
' -----[ Variables ]-------------------------------------------------------
lLine
VAR
rLine
VAR
' -----[ Program Code ]----------------------------------------------------
Main:
DO
GOSUB Read_Left
GOSUB Read_Right
DEBUG HOME,
"Left ", TAB, "Right", CR,
"-----", TAB, "-----", CR,
DEC lLine, CLREOL, TAB, DEC rLine, CLREOL
PAUSE 100
LOOP
END
' -----[ Subroutines ]-----------------------------------------------------
10
9
7
8
Word
Word
When over the black playing
' left line sensor power
' left line sensor input
' right line sensor power
' right line sensor input
' left sensor raw reading
' right sensor raw reading

Advertisement

Table of Contents
loading

This manual is also suitable for:

QuadcrawlerToddlerSumobotHexcrawler

Table of Contents