Infared Trouble (Any suggestions please)
I am in a highschool class and need some infared help with my boe-bot. I am new to basic stamp and have only a couple months of experiance. here is our code
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 = IN0
IF (irDetectLeft = 0) THEN
HIGH 10
ELSE
LOW 10
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
our wireing might be off but we copied it exactly to what your website has told us and have all the right resistors. We have tried switching out infared recievers and senders around and different combinations and it seems that it is not them that is not working. It is only the left side that does not work and when we did the roaming with whiskers program it was the same thing. Any sugestions, codes, or wireing help would be apreciated.
Thankyou -Adam4
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 = IN0
IF (irDetectLeft = 0) THEN
HIGH 10
ELSE
LOW 10
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
our wireing might be off but we copied it exactly to what your website has told us and have all the right resistors. We have tried switching out infared recievers and senders around and different combinations and it seems that it is not them that is not working. It is only the left side that does not work and when we did the roaming with whiskers program it was the same thing. Any sugestions, codes, or wireing help would be apreciated.
Thankyou -Adam4
Comments
·
·· In your class do you have another BASIC Stamp Module you could swap out of your board to verify if there is perhaps a damaged I/O pin?· If not you can test the I/O pins yourself by trying two simple circuits and noting the results.· First you can connect a push switch to each I/O pin and display the status of those pins on the DEBUG screen.· Next you can connect an LED through a 220 ohm resistor on each I/O pin and make the pin HIGH, PAUSE then make the pin LOW.· To be complete you would also need to check the low side driver by connecting the LED anode to Vdd and the cathode through a resistor to the I/O pin and make the pin LOW, PAUSE then make the pin HIGH.· Be sure to do this on both I/O pins used by the side you’re having the problem on, which would be P8 and P9, according to your code.· I hope this helps.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support