Autonomous stops working mid-program

Hello. So right now I am making my robot’s autonomous. For now, the robot only needs to open and close pistons, go forward, and then turn 90 degrees. Everything works until the robot has to turn, which the robot isn’t doing. The robot doesn’t do anything for what remains of the autonomous, even if we put more code after the turn.

We’ve tried taking out all the other code and making the robot only spin on the autonomous period. This works, but when we insert all the other code and make it turn at the end, it doesn’t do it. We also make pistons open again after the turn, which doesn’t work, proving that the program stops in the turn block.

Has anyone encountered a similar problem, and if so, how did you fix it? Thanks

Could you please post your code? I might have an idea of what’s wrong, but I can’t be sure without seeing the code.

Sure! This is what I have until now

snip autonomous

this could be a number of issues, what comes to mind is (if you have one) an inertial sensor. your port could be off on your inertial.
please post a video of your robot running this code.

My best guess is that the robot isn’t able to go 45 inches forward, so it’s getting stuck because it keeps trying to go farther forward but is physically blocked by something.

There’s a block that might be able to help:
image
This way, even if the robot can’t make it 45 inches, after five seconds it will stop trying to do that and continue on to the turn command.