View Single Post
  #4   Spotlight this post!  
Unread 19-02-2011, 20:36
Bot190's Avatar
Bot190 Bot190 is offline
Registered User
FRC #0166 (ChopShop)
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Merrimack NH
Posts: 105
Bot190 will become famous soon enough
Re: Autonomous Photosensor Programming

You should have gotten three of the photoelectic sensors in the Kit of Parts.
As others have said, you want to put the three line sensors in a row, spaced apart a little. Then you have to adjust them such that the LED's on the sensors change colors as you move the robot past the tape.

Then, depending on how you wired them, you will get a value from the sensor with a digitalinput. The Get method returns a value, 1 or 0 when the sensor sees the line, or doesn't, depending on how you wired them.

From there, you basically go forward while the center one is on the line, then if either side sees the tape, turn a bit until only the center sees the line.
__________________

Reply With Quote