27403 Parallax Inc, 27403 Datasheet - Page 57

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
Example Program: ThreeVariablesManyJobs.bs2
' Applied Robotics with the SumoBot - ThreeVariablesManyJobs.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}
' Variable Declarations
counter
temp
compare
' Set aside EEPROM storage space
Values
Threshold
' Get threshold value and store it in EEPROM
DEBUG CLS,
DEBUGIN DEC temp
WRITE Threshold, Word temp
"Enter a threshold value", CR,
"between 100 and 1000", CR,
">"
ENDIF
Enter, save, and run ThreeVariablesManyJobs.bs2.
Try feeding the program the same values shown in Figure 2-3 first. Then re-run
the program and use your own values.
Review the program. Pay special attention to the different kinds of jobs the
program does and how it uses and reuses
LOOP
DEBUG CRSRX, 0, DEC5 temp, CRSRX, 12
IF temp > compare THEN
ELSEIF temp < compare THEN
ELSE
ENDIF
DEBUG CR
counter = counter + 2
DEBUG "greater than"
DEBUG "less than"
DEBUG "equal to"
VAR
VAR
VAR
DATA
DATA
Byte
Word
Word
(40)
Word 0
temp
and
counter
so many times.

Related parts for 27403