Hi,
I am working on a project where the vehicle has to navigate a course. Here's a link to what I've done so far: - YouTube
That was all done off timing delays which was not very accurate.
I have added 4 infrared sensors (1 each side and 2 at the front) to allow the vehicle to know if it is going off the table and to know when to stop before dropping the bridge.
For the first leg (straight and turn right) I will use timing. Then after that I want to use the side sensor to make the left turn and carry on until the two front sensors reach the edge of the table. Then use timing to drop the bridge, drive across, winch up the bridge and make a left turn. Then use the sensor on the other side to prevent driving off the edge on the way to the finish.
I was thinking about using an arbitrary variable and then updating it based on conditions such as: if the first leg has been completed or if both front sensors are off the table etc. but I am not quite sure how to code it so some pseudo code would be great.
Pretty much i want to constantly check the sensors (for the sensing sections) then once its finished its leg, update the variable to start the next section. - If there's a better way code this course then any suggestions are appreciated
Any extra can be provided if need.
Thanks for your time.