28139 Parallax Inc, 28139 Datasheet - Page 37

KIT REMOTE IR FOR BOE-BOT W/TEXT

28139

Manufacturer Part Number
28139
Description
KIT REMOTE IR FOR BOE-BOT W/TEXT
Manufacturer
Parallax Inc
Datasheets

Specifications of 28139

Accessory Type
IR Remote
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Boe-Bot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
The code block in the this
larger than 2 ms, which means it must be the resting state between IR messages.
When the
deciding what to do next, the remote is sending the start pulse. This is the perfect time to
line up twelve
loaded into separate array elements. These twelve
how constant values such as 0, 1, 2 through 11 can be used to index elements in an array.
Next is an example of another way to index array elements, with a variable. In this case,
the variable is
argument in the
increases by one each time through the
value stored by each successive element in the
loop, the
time(1)
LOOP
, and so on.
DO
LOOP UNTIL time(0) > 1000
PULSIN 9, 0, time(0)
PULSIN 9, 0, time(1)
PULSIN 9, 0, time(2)
PULSIN 9, 0, time(11)
FOR index = 0 TO 11
NEXT
DEBUG
PULSIN
PULSIN 9, 1, time(0)
DEBUG CRSRXY, 0, 4 + index, "time(", DEC index, ")",
index
PULSIN
DEBUG
command displays
CRSRXY, 9, 4 + index, DEC time(index), CLREOL
command finishes measuring the resting pulse and the program is
, and it is incremented each time through a
commands to catch the twelve data pulses. Notice how each is
command is
DO…LOOP
keeps measuring high pulses until it finds one that's
FOR…NEXT
time(0)
DEC time(index)
Chapter 1: Infrared Remote Communication · Page 27
, the second time through, it displays
time
loop, the
PULSIN
array. The first time through the
. Since the value of
DEBUG
commands also demonstrate
FOR…NEXT
command displays the
loop. The last
index

Related parts for 28139