Heres a tip if your having problems staying on the line, make it go in reverse if no line is being read. Heres a picture of the temp configuration (gonna have a metal plate for final all neatly up under the hood. and holes in chasse for beam to get out.)) and a video of this year's sensors on last year's bot. The video is kinda bad example of how the code's working, the video is 15 sec, but it usually only take 7-11 seconds to get to the ball stand
http://home.comcast.net/~Catastrophy/picture.jpg
http://home.comcast.net/~Catastrophy/movie.avi
Here's the code tweaked for our bot if anyones interested.
Code:
if (dig12 == 1 && dig18 == 1){
pwm14=76;
pwm16=76;
}
if (dig18 == 1 && dig1 == 1 &! dig12 == 1 &! dig6 == 1){
pwm16=96;
pwm14=115;
}
if (dig18 == 1 &! dig1 == 1 &! dig12 == 1){
pwm16=86;
pwm14=115;
}
if (dig1 == 1 &! dig18 == 1 &! dig6 == 1){
pwm16=76;
pwm14=178;
}
if (dig12 == 1 && dig4 == 1 &! dig18 == 1 &! dig10 == 1){
pwm16=96;
pwm14=115;
}
if (dig4 == 1 &! dig12 == 1 &! dig10 == 1){
pwm16=178;
pwm14=76;
}
if (dig12 == 1 &! dig4 == 1 &! dig18 == 1){
pwm16=115;
pwm14=86;
}
if (dig1 == 0 && dig4 == 0 && dig12 == 0 && dig18 == 0 && dig8 == 0 && dig10 == 0 && dig6 == 0){
pwm14=155;
pwm16=155;
}
if (dig6 == 1 &! dig1 == 1){
pwm14=204;
pwm16=50;
}
if (dig8 == 1){
pwm14=127;
pwm16=127;
}
if (dig10 == 1 &! dig4 == 1){
pwm14=50;
pwm16=204;
}