Inertial Sensor Help: Infinite Turns

I have delcared my inertial sensor as part of my drivetrain, fixed the wire, and programmed it to turn 90 degrees for a sample code. Instead, it turns infinitely until the program is cut off. I calibrated it and that didn’t fix the problem. Help pls?

Edit: Yes, I am using block code so please explain it in those terms.

If it turns infinitely until the program is shut off, the problem is most likely with the inertial sensor’s reading. Did you wait 3 seconds until the inertial sensor has finished calibrating?

5 Likes

No, I will try that when I am back at the school tomorrow.

1 Like

I can attest that this will work, but it may glitch still once out of 30 times

1 Like

can you consider sharing your code so it is easier to diagnose the problem? Sounds like an infinite while loop to me

1 Like

So if you are doing something like a proportional loop the most probable issue is that your math is slightly wrong and that the drivetrain controller will then spin the robot in the “wrong” direction (away from 90), which results in the power increasing to max but not changing direction, thus spinning farther and farther away in a loop infinitely.

1 Like