27404 Parallax Inc, 27404 Datasheet - Page 153

COMPETITION RING FOR SUMOBOT

27404

Manufacturer Part Number
27404
Description
COMPETITION RING FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 27404

Accessory Type
Hobby and Education
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
Let's take a second look at that
counter
1,
note
Example Program: LookupExample.bs2
' Applied Robotics with the SumoBot - LookupExample.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}
LedSpeaker PIN 5
counter
note
DEBUG "Counter
FOR counter = 0 TO 7
NEXT
END
Your Turn
You can declare constants equal to the
lookup table.
LOOKUP counter, [1046, 1175, 1319,
DEBUG DEC counter, CRSRX, 9, DEC note, CR
FREQOUT 5, 500, note
PAUSE 25
LOOKUP
, and so on.
"-------
Enter, save, and run LookupExample.bs2.
Use the Debug Terminal to verify the relationship between the value
stores and the number between the square brackets that gets stored in the
variable.
is 0, the
VAR Byte
VAR Word
LOOKUP counter, [1046, 1175, 1319,
will copy 1175 to the note variable. If
Note",CR,
-------", CR
LOOKUP
1397, 1580, 1760,
1976, 2093], note
command will copy 1046 to the
1397, 1580, 1760,
1976, 2093], note
LOOKUP
note
command from Chapter 2, Activity #4. If
values, and then use those constants in the
counter
note
is 2, 1319 will be copied to
variable. If
counter
counter
note
is

Related parts for 27404