Society of Robots - Robot Forum

Mechanics and Construction => Mechanics and Construction => Topic started by: squall0312 on October 30, 2009, 08:04:01 AM

Title: Help on $50 dollar robot...it only goes on a straight line
Post by: squall0312 on October 30, 2009, 08:04:01 AM
Need your help on my $50 dollar robot...

I followed everything in the tutorial and it is almost finished but when i
programmed it, it just run on a straight line...

*I think its not the program because i received no error when i burn it and i can read from the MCU.

*I checked the photoresistor and found out that it has a very large resistance value...do you think this is the problem?

I am using an ATMEGA8L instead of the ATMEGA8 in the tutorial, i can't find an ATMEGA8 here in the Philippines.
Title: Re: Help on $50 dollar robot...it only goes on a straight line
Post by: SmAsH on October 30, 2009, 03:55:41 PM
The photoresistor is most likely the problem, the robot is probably thinking both are seeing light so go forward.
Are you able to get your hands on lower value photoresistors to test this with?
Title: Re: Help on $50 dollar robot...it only goes on a straight line
Post by: Joker94 on October 30, 2009, 04:01:29 PM
well for now to test your bot before you go out and buy some more photoresistors you might be able to test it in a dark room with a torch that way there is only one light source for it to follow.
Title: Re: Help on $50 dollar robot...it only goes on a straight line
Post by: squall0312 on October 30, 2009, 07:58:46 PM
I finally made the robot work... :D!

My robots function is to follow a certain line on a black background(i used black to make it easier...).

i changed the photoresistor connection so that the voltage increases as the light increases
then i modified the code...on the direction control i removed some code:

servo_left(25)
servo_right(44)

i just remove one of the servo when it needs to turn to a certain direction... :D!

i also modified the a2dconvert8bit procedure, i just copied the one on the a2dconvert10bit and then i pasted it to the 10bit then it worked perfectly... :D!

I'll post some pictures when the robot is 100% done...

"SOCIETY OF ROBOTS ROCKS!" 8)!

Thanks guys... ;)!
Title: Re: Help on $50 dollar robot...it only goes on a straight line
Post by: Joker94 on October 31, 2009, 06:16:27 PM
very well done on fixing the problem.

can't wait to see the pictures.