Hi all, I built a robot with Arduino avoiding obstacles. Not being very good at programming, I found a code online and I adapted to my “needs”. Despite all the problems persist …
1- The robot turns just right, I suspect that the problem is this: in checkpath () is if (curDist> curDist) that is never checked and maxAngle is never set to remain at 0.
I tried in every way but I can not remedy.
2- Although there is no obstacle in front, sometimes the robot goes back … I run checkCourse () but I do not understand why …
These are the issues that I would solve … I trust in you I desperately need help! Thanks in advance to all! I attach the code.
motor shield L293D
hc-SR04 ultrasonic sensor
4 Dc motors
2 x 4 battery pack
APC_4_ROBOT.ino (10.1 KB)