|
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.
__________________
|