Shop OBEX P1 Docs P2 Docs Learn Events
IR problem — Parallax Forums

IR problem

keroo_maxkeroo_max Posts: 8
edited 2005-10-14 14:19 in BASIC Stamp
Hi ,

I'm modifying my Boe bot to have more sensors(about 5 IR) and Couple of Ping)). but i'm having a problem with the number of pins on the Bs2. Cause To build only 5 IRs sensors it requires 10 pins. So i thought i would try only one pin to send pulses to all the IR leds. but in this case only one tranciever works.

any suggestions??

Comments

  • keroo_maxkeroo_max Posts: 8
    edited 2005-10-14 04:15
    i know for sure there's nothing wrong in the hardware cause i measured the i/o on the tranciever and i get the correct answers...
    i think my error in the code specially i'm trying to equalize 2 variables with input of two pins in the same time

    FREQOUT 0,10,25000 'pin zero where the ir led is connected
    irleft = IN1 'pin 1 goes to the 1st tranciever
    iright= IN14 'pin 14 goes to the 2nd tranciever

    ??
  • keroo_maxkeroo_max Posts: 8
    edited 2005-10-14 04:17
    irleft VAR Bit
    iright VAR Bit

    LOW 15
    LOW 13

    DO

    FREQOUT 0,10,25000
    irleft = IN1
    iright= IN14

    'DEBUG ? IN14
    IF(irleft=1) THEN

    LOW 13
    'DEBUG ? iright

    ELSEIF (irleft=0) THEN
    HIGH 13
    'DEBUG ? irleft
    ENDIF

    IF (iright=0) THEN
    HIGH 15

    DEBUG ? iright

    ELSEIF (iright=1) THEN
    LOW 15
    DEBUG ? iright

    ENDIF




    LOOP
  • Tom WalkerTom Walker Posts: 509
    edited 2005-10-14 14:19
    I would guess that the process would have to go something like this on a single-tasking Stamp:

    1. fire your IR led
    2. loop rapidly, examining your receivers' pin set (all pins that have receivers attached to them AT THE SAME TIME) looking for a change which should indicate that something was received.
    3. evaluate the changed status for which receiver was activated and how long it took for the "bounce".

    It seems to me that this will require an IR led which is fairly high power and modified so that it doesn't focus in too small a direction. Couple this with the timing criticality and I'd recommend more of a co-processor set-up.

    HTH

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
Sign In or Register to comment.