29122 Parallax Inc, 29122 Datasheet - Page 4

KIT PARTS IR REMOTE FOR BOE-BOT

29122

Manufacturer Part Number
29122
Description
KIT PARTS IR REMOTE FOR BOE-BOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 29122

Accessory Type
IR Remote
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
LOOP
How IrRemoteCodeCapture.bs2 Works
Each time through the outermost DO…LOOP, the value of remoteCode is cleared. There's also an inner
DO…LOOP with an RCTIME command to detect the end of a high signal that lasted longer than 2 ms.
This indicates that the rest between message packets just ended, and the start pulse is beginning. The
first PULSIN command captures the first data pulse, and the IF…THEN statement that follows uses the
value of the irPulse variable to either set (or leave clear) the corresponding bit in the remoteCode
variable. Since the next data pulse has already started while the IF…THEN statement was executing, the
remainder of the next data pulse is measured with an RCTIME command. This next value is again used
to either set (or leave clear) the next bit in remoteCode. This is repeated five more times to get the rest
of the useful part of the IR message and set/clear the rest of the bits in remoteCode.
The BS2sx and BS2p handle remote codes a little differently. The programs usually search for the actual
start pulse with a PULSIN command instead of searching for the resting state between messages. They
also use PULSIN commands to capture all the pulses since the IF…THEN statements that sets bits in the
remoteCode variable complete before the starting edge of the next data pulse. To see a code example
that does this, see the #CASE statement for the BS2sx and BS2p inside the next example program's
Get_Ir_Remote_Code subroutine.
BASIC Stamp 2 Series Application Example – IrRemoteButtonDisplay.bs2
You can use this application example with BASIC Stamp 2, 2e, 2sx, 2p or 2pe modules to test your
remote and display which key you pressed.
You can modify or expand the SELECT…CASE statement to test for VCR keys defined in the Constants
section (Play, Stop, Rewind, etc.). There are usually several different codes for configuring universal
remotes to control SONY VCRs, so you may need to try a few before finding the code that makes the
Page 4 of 10
RCTIME 9, 0, irPulse
IF irPulse > 300 THEN remoteCode.BIT3 = 1
RCTIME 9, 0, irPulse
IF irPulse > 300 THEN remoteCode.BIT4 = 1
RCTIME 9, 0, irPulse
IF irPulse > 300 THEN remoteCode.BIT5 = 1
RCTIME 9, 0, irPulse
IF irPulse > 300 THEN remoteCode.BIT6 = 1
' Map digit keys to actual values.
IF (remoteCode < 10) THEN remoteCode = remoteCode + 1
IF (remoteCode = 10) THEN remoteCode = 0
DEBUG CLS, ? remoteCode
As with the previous example program, make sure your remote is configured to control a SONY
TV first.
Update the $Stamp directive for the BASIC Stamp module you are using.
Download or hand enter, then run IrRemoteButtonDisplay.bs2.
Point the remote at the IR detector, press and release buttons
Make sure the Debug Terminal reports the correct button. Start with digits, channel, volume, etc.
© 2004 Parallax Inc. • IR Remote AppKit (#29122) • 10/2004
' Repeat main DO...LOOP

Related parts for 29122