Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: switchblade on January 26, 2009, 09:29:45 PM

Title: help in writing code
Post by: switchblade on January 26, 2009, 09:29:45 PM
hey guys I am a final year student doing an electronics diploma and i have decided to build a line following robot with obstacle detection as myy final year project. I have all the electronics parts down but i am really baffled on how to start programming the pic. If i dont do this project well i'll get kicked out of school.
I really want to do this project properly.
A typical confusion of mine is:
For example i know how to build the light sensor array and send the feedback to the input of the PIC but how do I instruct the PIC to tell the motors to move left and right and by how much to do this according to which sensor sends back a signal??

I would appreciate any help.........damn if i have to pay for help i mite do it lol
but please guys i'm a desperate here
Title: Re: help in writing code
Post by: cosminprund on January 27, 2009, 09:38:08 AM
Google is on your side and it will not complain about helping you with school projects.
Google for "PIC line following"; The third link is a link back to this site, there's a tutorial for doing line following with an PIC18F; In includes source code:

http://www.societyofrobots.com/robotforum/index.php?topic=4693.0
Title: Re: help in writing code
Post by: Soeren on January 27, 2009, 10:01:01 AM
To that, I'll have to add.
Remember that you need to understand it completely to write your report!

And if you get kicked out, you probably never should be let into engineering - just call me oldfashioned, but I'd hate to board a plane where a near-flunkee (who just got his/hers exam by other peoples help/designs) made some of the flight control design!
Title: Re: help in writing code
Post by: switchblade on January 27, 2009, 05:00:52 PM
haha true there is no way in hell i will go to the final interview with my project that is something copy and pasted..........thats why i am trying to understand how to do this. Yup google has alot of stuff but the problem is where to start!!

i started my hardware design what i am using for the line dectector and motor control but i am having trouble visualising how to control the motors to turn left and right smoothly. But i'll try n ponder on that. Thanks for the feedback guys