Robot going in circles

Hi! I’m trying to code an autonomous run and now im randomly encountering an issue with turning. I have another run programmed, super simple, its just driving and turning and this one works with no prob. But, with this one, when i tell it to turn it turns around slowly, trying to figure out where to go before proceeding in a totally different direction. Power cycling it does nothing either.

I figured this was a gyro issue, so i disconnected it and changed my code. The issue persisted. Now instead of gingerly turning around, it spins around twice before proceeding in the wrong direction (again).
Ive tried looking at other posts here and nothing gives me a solution for my issue :frowning: . What am i doing wrong here ??

It seems likely this is a code issue. A general tip, if you have a complex program that has the issue and the simple one is not causing it, consider making a duplicate and taking out as much as possible (one at a time) until the problem exists in a program with 5 lines of code, or you find one specific change that is causing the issue. (this may not work for highly interconnected programs, but that does not sound like yours)

Otherwise, make sure your motors are connected to the ports you expect them to be for both programs.

If neither of those work, please post your code for the simplest program that still has the error.

2 Likes