IR help
Hi guys..
I am totally new to robots so forgive my noobish ways.
I put a ir emitter and a ir dectector on my robot ... I hooked the emitters + side to hot (6v) and the - side to a 220ohm resistor and then hooked the resistor to pin# 0 .. For the detector I hooked up ( facing towards me) the left side to a 220ohm resistor and then the resistor to pin #5 the middle to ground and the right to hot.
I used the fallowing code to test it
Have I done any thing wrong? because it is not working... I get nothing on the debug screen.
Let me know if I hooked something up wrong or if my code is bogus.
thanks guys!
-Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit my website @ www.kd7lax.com- Devoted to ham radio
I am totally new to robots so forgive my noobish ways.
I put a ir emitter and a ir dectector on my robot ... I hooked the emitters + side to hot (6v) and the - side to a 220ohm resistor and then hooked the resistor to pin# 0 .. For the detector I hooked up ( facing towards me) the left side to a 220ohm resistor and then the resistor to pin #5 the middle to ground and the right to hot.
I used the fallowing code to test it
' -----[noparse][[/noparse] Title ]---------------------------------------------------------------- ' Mini Sumo 4.1 : IR Sensor Test ' {$STAMP BS2} ' -----[noparse][[/noparse] I/O Definitions ]------------------------------------------------------ LfIrOut CON 0 ' left IR LED output LfIrIn VAR IN5 ' left IR sensor input ' -----[noparse][[/noparse] Variables ]------------------------------------------------------------ irBits VAR Nib ' storage for IR target data irLeft VAR irBits.BIT1 ' -----[noparse][[/noparse] Main Code ]------------------------------------------------------------ Read_Left: FREQOUT LfIrOut, 1, 38500 ' modulate IR LED irLeft = ~LfIrIn ' read input (1 = target) Display: DEBUG HOME DEBUG "L", CR DEBUG "--",CR DEBUG BIN1 irLeft PAUSE 20 GOTO Read_Left
Have I done any thing wrong? because it is not working... I get nothing on the debug screen.
Let me know if I hooked something up wrong or if my code is bogus.
thanks guys!
-Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit my website @ www.kd7lax.com- Devoted to ham radio
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Do you think I burnt it out by not using a 1k ? I thought the sumobot manual said 220?
thanks
-Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit my website @ www.kd7lax.com- Devoted to ham radio
·· Sumobot?· Ah, now in looking closer at your code I see(you didn't specify in your text)...I thought you had a BOE-Bot.· The Sumobot LED connects directly without the resistor, since it is built into the board.· And it is designed to work with the 220 ohm that is there.· The detector is also designed to just plug in.· How are you connecting these?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Well actually I am building my robot from scratch [noparse]:)[/noparse] (sorry I did not mention this) but it is a sumo bot ... and I am using alot of the same parts as your sumo bot.. the only difference is I am building my own PCB and frame.
I got the IR sensor to work after installing a 1k resistor ... I didn't have a solid connection to my I/O pin before.. I think that was the cause of my problems.
Right now I have my robots frame done and I am building the whole circuit on a breadboard so I can get a feel for how my PCB is going to be designed. I am using a BS2 OEM chip for this.
Thanks for your help! I am sure I will have more questions as soon as get the QTI sensors on [noparse]:)[/noparse]
-Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit my website @ www.kd7lax.com- Devoted to ham radio