|
Re: Autonomous Photosensor Programming
Quote:
Originally Posted by Robby Unruh
How are you guys programming your Y's? I'm having some trouble with mine. Any tips would be really appreciated.
|
Our robot drives straight on the line, so it notices when the middle sensor is no longer over the tape, but the left and right both are. At that point, we begin turning in the direction we want to go. Using the code you've already posted as a template:
Code:
if(left.get() && !middle.get() && right.get()) {
// turn left or right, depending on what you want
}
It wouldn't go on as another else, it would be a separate if, or it would never be triggered.
__________________
while(!going.isTough());
tough.exit();
What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.
Last edited by Patrickwhite : 20-02-2011 at 21:29.
Reason: forgot to write the point of the post
|