|
Re: How do u get your robot to follow the white line??????????????????
I dont have any code that you can cut and paste
but the algorythm is pretty simple if you have two sensors on your bot
you would put them on either side of the line, tell your bot to normally go straight ahead at a relatively slow speed.
then if the left sensor sees the line, turn towards the left
if the right sensor sees the line, turn towards the right
if neither sensor sees the line, go straight ahead.
you will have to test the code on your bot with the sensors and adjust how fast the bot moves forwards, and how hard it turns when it sees the line. You might also need to tell it to stop moving forward when its turning.
thats the simple version of it.
|