infared trouble
on my boe-bot·(basic stamp 2) i have infared sensors. the left one work very well but the right one dosent work. tryed to switch around parts and it the same senario. the left one is great and the right one is still not functioning. when i set the "IN" and make it "IN1" the right sensor·swiches back and forth·1 then 0, 1 then 0,1 then 0, 1 then 0 ( i used the de-bug terminal). here is the program.
······ ' Robotics with the Boe-Bot - TestIrPairsAndIndicators.bs2
' Test IR object detection circuits.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
'
Variables
irDetectLeft VAR Bit
irDetectRight VAR Bit
'
Initialization
DEBUG "Testing piezospeaker..."
FREQOUT 4, 2000, 3000
DEBUG CLS,
"IR DETECTORS", CR,
"Left Right", CR,
"
"
'
Main Routine
DO
FREQOUT 8, 1, 38500
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN1
IF (irDetectLeft = 0) THEN
HIGH 1
ELSE
LOW 1
ENDIF
IF (irDetectRight = 0) THEN
HIGH 1
ELSE
LOW 1
ENDIF
DEBUG CRSRXY, 2, 3, BIN1 irDetectLeft,
CRSRXY, 9, 3, BIN1 irDetectRight
PAUSE 100
LOOP
·
······ ' Robotics with the Boe-Bot - TestIrPairsAndIndicators.bs2
' Test IR object detection circuits.
' {$STAMP BS2} ' Stamp directive.
' {$PBASIC 2.5} ' PBASIC directive.
'
Variables
irDetectLeft VAR Bit
irDetectRight VAR Bit
'
Initialization
DEBUG "Testing piezospeaker..."
FREQOUT 4, 2000, 3000
DEBUG CLS,
"IR DETECTORS", CR,
"Left Right", CR,
"
"
'
Main Routine
DO
FREQOUT 8, 1, 38500
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN1
IF (irDetectLeft = 0) THEN
HIGH 1
ELSE
LOW 1
ENDIF
IF (irDetectRight = 0) THEN
HIGH 1
ELSE
LOW 1
ENDIF
DEBUG CRSRXY, 2, 3, BIN1 irDetectLeft,
CRSRXY, 9, 3, BIN1 irDetectRight
PAUSE 100
LOOP
·
Comments
I also face the same problem before but after change the IR receiver with a new set it works fine.
You should try this. Switcing around the parts will never solve your problem if one of the IR receiver got problem.
Test your IR receiver with multimeter.
·
·· You’re making the input pin a HIGH right after the instruction, which makes it an output…Please recheck your original code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support