Inertial sensor keeps causes the robot to keeps rotating in a circle

the code was working fine the robot was turning in a perfect square but then all of a sudden it decided to just not work

I have had the same problem. This happens when the inertial sensor doesn’t finish calibrating. Put a wait .75 sec block to make sure it calibrated and then try it.

3 Likes

were exactly do i put it, because it’s there below calibrate it’s 1 second wait

1 Like

The v5 inertial sensors auto-calibrate, so you do not need to add a calibrate blook. As for the turning, I would first check the port on the code and make sure that it lines up. Secondly, check the orientation of the sensor. the wire output/plug goes to the back of the robot.
Do not move the robot after starting the code. I would also mount it as close to the turning center as possible.

For us, it kept spinning because we said

turn left

if inertial sensor value = 300
then stop

But we actually need a range:

If inertial sensor value > 295 && 305 > inertial sensor value
then stop

and this way worked.
Do you have a range?

i tried it in a range and it worked thanks