Hello everyone,
I am working on this project where I have built a robot that will travel through a maze. The maze has lines in it so that it becomes a grid pattern as shown:
The entire maze has these grid line on the floor, and the bolder lines are the walls. I am using line sensors to find these lines so that the robot knows its position throughout the maze, and can properly orient itself. There are two line sensors on either side of the robot, and if it is off it takes into account the different times when the two sensors see the line. However, this is where the problem takes place. When reviewing my code I tried to account for all different issues that I may face, and when testing it I found the issue to be the millis() function. Everything up to when the robot is suppose to record the time was working, and thereby disrupting my code. My entire code is linked below, along with another file that has a working model of the millis() function. If anyone has any suggestions or solutions, it would be extremely helpful. Another thing I ask is if you can review my code just in case I may have missed something. I would like to thank everyone for their help in advance!
I am working on this project where I have built a robot that will travel through a maze. The maze has lines in it so that it becomes a grid pattern as shown:
The entire maze has these grid line on the floor, and the bolder lines are the walls. I am using line sensors to find these lines so that the robot knows its position throughout the maze, and can properly orient itself. There are two line sensors on either side of the robot, and if it is off it takes into account the different times when the two sensors see the line. However, this is where the problem takes place. When reviewing my code I tried to account for all different issues that I may face, and when testing it I found the issue to be the millis() function. Everything up to when the robot is suppose to record the time was working, and thereby disrupting my code. My entire code is linked below, along with another file that has a working model of the millis() function. If anyone has any suggestions or solutions, it would be extremely helpful. Another thing I ask is if you can review my code just in case I may have missed something. I would like to thank everyone for their help in advance!
Attachments
-
41.9 KB Views: 10
-
279 bytes Views: 4