Shop OBEX P1 Docs P2 Docs Learn Events
infared trouble — Parallax Forums

infared trouble

adam4adam4 Posts: 10
edited 2008-01-20 22:09 in BASIC Stamp
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
·

Comments

  • azmax100azmax100 Posts: 173
    edited 2006-12-30 03:08
    Hi adam4.

    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.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-30 22:28
    Adam4,
    ·
    ·· 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
  • jdpetersdocjdpetersdoc Posts: 26
    edited 2008-01-20 22:09
    I had the same proble but i had so resistor leads touching some yeah.
Sign In or Register to comment.