Hi, I am looking to optimize my TravelStraightForward18cm() function by making its logic simpler and faster to process. Currently, the function i have does work without any problems as i have tested it on my robot. But, I have noticed that when i upload the whole program, my program crashes sometimes. I suspect it could be due to complicated or long logic statements. If you guys can let me know how to write it simpler, i'd be happy to know.
myCode.ino (1.72 KB)