View Single Post
  #11   Spotlight this post!  
Unread 21-02-2004, 07:23
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: line seeking help needed

Quote:
Originally Posted by Jamie_Richard
This looks excellent, after sitting around looking out our programmers figure out nothing last night this is a breath of fresh air. I personally am not a programmer, but I am going to try to implement this tonight after the Suffield Scrimmage. We were using two sensors, and something didn't seem right about it, does anyone have any reccomendations, when using three sensor, on how to make the robot go backwards if its not seeing the line. I have a very limited knowledge of C, and I feel our programmers are uncomfortable with the platform this year. so...

If you guys can help me make this work, there will be Krispy Kreme's at Hartford (or Atlanta) for you, on me.

Thanks a Bunch!
Jamie
Catastrophy might have a more advanced solution, but basically, if you don't see the the line with any of your sensors, reverse. Something like this:
Code:
if(rc_dig_01 == 0 && rc_dig_02 == 0 && rc_dig_03 == 0)
{
   pwm01 = 0;
   pwm02 = 0;
}
You would, of course, have to add the code for actually following the line, but that is basically all you have to do to reverse if you don't see anything on the sensors.

PS the digital inputs are your sensors and the pwmXXs are the drive motors.

PPS Nine banners. Crazy.
__________________