Need Help with IR sensors
Attached the IR sensors to BOE BOT. Wrote the following program to test. Once the sensors detect an object, the 2 irDetect values remain at 0 regardless of where I placed the BOT.
irDetectLeft VAR Bit ' Variable Declarations..
irDetectRight VAR Bit
counter VAR Bit
FREQOUT 4, 2000, 3000
DO ' Main Routine..
FREQOUT 8, 1, 38500 ' Check IR Detectors..
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN0
DEBUG CLS
IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN 'Interference found
DEBUG CRSRXY, 2, 3, BIN1 irDetectLeft,
CRSRXY, 9, 3, BIN1 irDetectRight
ELSE 'No interference
DEBUG CR, "i am here"
ENDIF
PAUSE 1000
LOOP
irDetectLeft VAR Bit ' Variable Declarations..
irDetectRight VAR Bit
counter VAR Bit
FREQOUT 4, 2000, 3000
DO ' Main Routine..
FREQOUT 8, 1, 38500 ' Check IR Detectors..
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN0
DEBUG CLS
IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN 'Interference found
DEBUG CRSRXY, 2, 3, BIN1 irDetectLeft,
CRSRXY, 9, 3, BIN1 irDetectRight
ELSE 'No interference
DEBUG CR, "i am here"
ENDIF
PAUSE 1000
LOOP
Comments
Looks like that R is going to Det's middle terminal?
[Should be in the 3rd row down from the V_ss header.]
The leads of the resistors in P0 and P2 look very close (touching?).
PE - There's also a note on p243 about sensitivity and experimenting with resistor values for the IREDs (IRLEDs).