View Single Post
  #1   Spotlight this post!  
Unread 23-03-2004, 02:01
PBoss PBoss is offline
Registered User
#1212
 
Join Date: Jan 2003
Location: Nowhere
Posts: 9
PBoss is an unknown quantity at this point
A quick IR sensor question

Hi everyone,
I just have one quick question. We do our autonomous by dead reckoning, but have put one IR sensor on the robot (at the right height for the beacon, without a servo). All we want to be able to do at the end of our dead reckoning code, is to find a beacon (any one of the two) and go to it.I attached the sensor to digital input one, and here is what my code reads:

....
if(dig_in_01==0)
{
//drive left and right (to find the beacon)
}
else
{
//drive forward for 5 secs.(when find the beacon)
}

Will this code work. Also, will the digital input become 1 is it sees any of the two beacons, or I have to specify which beacon I want it to look for. If I have to specify the frequency or whatever, how do I do that. I don't want to mess with all the complicated IR code out there to measure distance or anything. I just want to know when my sensor sees the beacon, thats it. We have a regional coming up, so any help would be appreciated.
Thanks,