IR problem
keroo_max
Posts: 8
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??
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
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
??
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
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...