Why are you using two receivers? If both are 38kHz, both will see both signals. Whichever pin is triggered first will seize control.
Why are you using two receivers? If both are 38kHz, both will see both signals. Whichever pin is triggered first will seize control.
Hey Guys,
I had made the following changes to the code, and added the "DEFINE PULSIN_MAX 300" line to the top of the code. It now works for GPIO.3 most of the time but it does not work at all on GPIO.2. The modules are 38Khz dave but i am not sure what you mean by "both will see both signals. Whichever pin is triggered first will seize control. "
<code>
STARTPULSE:
PulsIn GPIO.3,0,CODELENGTH 'MEASURE LOW PULSE (IR LED ON TIME)
IF (CODELENGTH > 200) and (CODELENGTH < 400) Then SENSOR1
PulsIn GPIO.2,0,CODELENGTH 'MEASURE LOW PULSE (IR LED ON TIME)
IF (CODELENGTH > 200) and (CODELENGTH < 400) Then SENSOR2
goto STARTPULSE
SENSOR1:
RXPIN1 = GPIO.3
pin = 1
GOTO CODEPULSES
SENSOR2:
RXPIN1 = GPIO.2
pin = 2
GOTO CODEPULSES
</code>
Thanks Again,
Jeremy
Place PulsIn GPIO.2,0,CODELENGTH before PulsIn GPIO.3,0,CODELENGTH.
Does it work with the sensor on GPIO.2 now?
Unless the two receivers are optically isolated so that neither can see the signal intended for the other, both will see all signals.
The first one in your code will process the signal, blocking all of the code statements for the other one.
If you follow Bruce's suggestion, the one that wasn't working will start working but the other will stop working.
Bookmarks