27403 Parallax Inc, 27403 Datasheet - Page 134

GUIDE APP ROBOTCS W/SUMOBOT V1.0

27403

Manufacturer Part Number
27403
Description
GUIDE APP ROBOTCS W/SUMOBOT V1.0
Manufacturer
Parallax Inc
Datasheet

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
The best thing about this arrangement is that no other changes in the program have to be
made. The program will still function normally, and you can display each bit value as
before.
Your Turn - Working with the Sensors Byte
Here is an alternate Initialization and Main Routine you can try to see how a byte can
show you different patterns of bits (1s and 0s). A
builds a display heading to label each bit in the sensors variable, with a reference to the
sensor whose status that bit stores. Then a
updates the value of the
irLS
irLF
irRF
irRS
Save TestAllSensorsYourTurn.bs2 as SensorsWithFlagsByte.bs2.
Modify the variable declarations as explained in this activity.
Test the program and verify that it still works the same.
' -----[ Initialization ]----------------------------------------------
GOSUB Calibrate_Qtis
' Display heading
DEBUG CLS, " PB", CR,
' -----[ Main Routine ]------------------------------------------------
DO
LOOP
GOSUB Read_Line_Sensors
GOSUB Read_Object_Detectors
GOSUB Read_Pushbutton
DEBUG CRSRXY, 0, 4, BIN8 sensors
PAUSE 100
" |QTI",CR,
" |||IROD",CR,
" |||||||",CR,
CR,
" |||||||", CR,
"
"
sensors
LRLLRR", CR,
FFSFFS"
VAR
VAR
VAR
VAR
variable, and displays in a second
sensors.BIT3
sensors.BIT2
sensors.BIT1
sensors.BIT0
DO...LOOP
' Determine b/w threshold
' Pushbutton
' QTI line sensors
' Infrared Object Detectors
' Sensors byte goes here
' Left/right
' Front/side
' DO...LOOP repeats indefinitely
' Look for lines
' Look for objects
' Check pushbutton
' Display Sensors Variable
DEBUG
' State of Left Side IR
' State of Right Side IR
' State of Right Front IR
' State of Right Side IR
' Delay for slower PCs
in the Main Routine constantly
command in the Initialization
DEBUG
command.

Related parts for 27403