27403 Parallax Inc, 27403 Datasheet - Page 197
![GUIDE APP ROBOTCS W/SUMOBOT V1.0](/photos/8/99/89972/mfg_27403_sml.jpg)
27403
Manufacturer Part Number
27403
Description
GUIDE APP ROBOTCS W/SUMOBOT V1.0
Manufacturer
Parallax Inc
Datasheet
1.27404.pdf
(266 pages)
Specifications of 27403
Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
- Current page: 197 of 266
- Download datasheet (6Mb)
Moving the State Routines to Subroutines
Here is the Main Routine from the upcoming example program SumoWrestler.bs2, a
revision of TestSumoWrestler.bs2 in which all of the state routines have been moved to
subroutines. It's quite clean and easy to read, isn't it?
' -----[ Main Routine ]-------------------------------------------------------
DO
LOOP
The code block for each navigation state now resides in a subroutine. Here is an example
of
unchanged from the way it was in the main routine. The only difference is usually the
label and
qtiLF
qtiRF = ~qtiSigRight
LOW qtiPwrLeft
LOW qtiPwrRight
RETURN
IF qtiLF = 1 THEN
ELSEIF qtiRF = 1 THEN
ELSEIF irLF = 1 AND irRF = 1 THEN
ELSEIF irLF = 1 THEN
ELSEIF irRF = 1 THEN
ELSEIF irLS = 1 THEN
ELSEIF irRS = 1 THEN
ELSE
ENDIF
Avoid_Tawara_Left
GOSUB Avoid_Tawara_Left
GOSUB Avoid_Tawara_Right
GOSUB Go_Forward
GOSUB Track_Front_Left_Object
GOSUB Track_Front_Right_Object
GOSUB Track_Side_Left_Object
GOSUB Track_Side_Left_Object
GOSUB Search_Pattern
' -----[ Subroutine - Avoid_Tawara_Left ]------------------------------
Avoid_Tawara_Left:
RETURN
= ~qtiSigLeft
FOR counter = 1 TO 15
command.
.
For the most part, the actual code in each subroutine is
' Snapshot of QTI signal states
' Turn off QTIS
' Left qti sees line?
' State = avoid left tawara
' Right qti sees line?
' State = avoid right tawara
' Both? Lunge forward
' State = Go forward
' Just left?
' State = Track front left obj.
' Just right?
' State = Track front right obj.
' Left side?
' State = track side left obj.
' Right side?
' State = track side right obj.
' Nothing sensed?
' State = Search pattern
' Back up
Related parts for 27403
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![30008](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
![70009](/photos/26/92/269208/70009-l_tmb.jpg)
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
![27404](/photos/26/91/269197/27404-l_tmb.jpg)
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
![70016](/photos/8/99/89966/mfg_70016_tmb.jpg)
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
![28135](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
![28023](/photos/9/30/93020/mfg_28023_tmb.jpg)
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
![30010](/photos/9/30/93025/mfg_30010_tmb.jpg)
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
![SX18AC/SO](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: