Shop OBEX P1 Docs P2 Docs Learn Events
range of IR LEDs — Parallax Forums

range of IR LEDs

julius.meinljulius.meinl Posts: 6
edited 2009-03-16 21:23 in Accessories
Hi,

I try to biuld a circiut to wireless communication with two BS2. idea.gif


01f813fbef43a8ccm.jpg


First module is a receiver ( standard Infrared Receiver 350-00014 )

4b42c880a32fa62c.jpg

And there is a code:

' {$STAMP BS2}
 ' {$PORT COM5}
' {$PBASIC 2.5}

time VAR Word(12)
index VAR Nib



' Display heading.

DEBUG "time ARRAY", CR,
"PWM MEASUREMENTS", CR,
"Element Duration, 2-us", CR,
"------- --------------"

DO ' Beginning of main loop.

DO ' Wait for rest between messages.

PULSIN 0, 1, time(0)
LOOP UNTIL time(0) > 1000
PULSIN 0, 0, time(0) ' Measure/store data pulses.
PULSIN 0, 0, time(1)
PULSIN 0, 0, time(2)
PULSIN 0, 0, time(3)
PULSIN 0, 0, time(4)
PULSIN 0, 0, time(5)
PULSIN 0, 0, time(6)
PULSIN 0, 0, time(7)
PULSIN 0, 0, time(8)
PULSIN 0, 0, time(9)
PULSIN 0, 0, time(10)
PULSIN 0, 0, time(11)

FOR index = 0 TO 11                      ' Display 12 pulse measurements.

DEBUG CRSRXY, 0, 4 + index, "time(", DEC index, ")",
CRSRXY, 9, 4 + index, DEC time(index), CLREOL

LOOP




Second module is a transmitter ( with 350-00017 IR Transmitter )

7b854597fd740644.jpg



' {$STAMP BS2}
' {$PBASIC 2.5}
 ' {$PORT COM4}

pi CON 8
fr CON 38000


DO

'PULSOUT 0,1
        'HIGH 0

PAUSE 22

'LOW 0




FREQOUT pi, 3, fr ' Start pulse
PAUSE 1
FREQOUT pi, 2, fr ' Bit-0 = binary-1
PAUSE 1
FREQOUT pi, 2, fr ' Bit-1 = binary-0
PAUSE 1
FREQOUT pi, 2, fr ' Bit-2 = binary-0
PAUSE 1
FREQOUT pi, 2, fr ' Bit-3 = binary-1
PAUSE 1
FREQOUT pi, 2, fr ' Bit-4 = binary-0
PAUSE 1
FREQOUT pi, 2, fr ' Bit-5 = binary-0
PAUSE 1
FREQOUT pi, 1, fr ' Bit-6 = binary-0
PAUSE 1
FREQOUT pi, 2, fr ' Bit-7 = binary-0
PAUSE 1
FREQOUT pi, 2, fr ' Bit-8 = binary-0
PAUSE 1
FREQOUT pi, 2, fr ' Bit-9 = binary-0
PAUSE 1
FREQOUT pi, 2, fr ' Bit-10 = binary-0
PAUSE 1
FREQOUT pi, 2, fr ' Bit-11 = binary-0


LOOP




Everything it's OK, but ...
If I use Universal Remote (020-00001) I can directed the remote no matter where and It's OK, but if I use the second module I have to refer them directly to the receiver, so if I want to comunicate two boe-bot robots with this circuit It will be big problem. cry.gif

Can someone help me ? rolleyes.gif

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-03-16 21:23
    It's probably a combination of low current through the LED and a low viewing angle of the LED. The LEDs in the remote are probably wide angle (100 degrees or so...). The easiest way to fix this would be to half the resistor value and get a wider angle LED (make sure it's the same wavelength).
Sign In or Register to comment.