Code only runs 5 lines and stops

The Clawbot will only run 5 lines of code. We can switch the code around and it will only run 5 lines thenImage 11-11-21 at 12.57 PM stop. I have another group that has 156 lines of code. It runs to line 39 and stops.

Would you be able to share all your code, preferably in code tags?

code tags

And possibly add a .zip of all your code

so it gets stuck on clawMotor.spinToPosition ? Perhaps the claw motor cannot turn that far.


I had this problem for such a long time. Like jpearman said, the clawMotor is getting stuck and cannot turn to that position.

Try setting a ClawMotor.setTimeout(1, seconds); at the start of the program. This means if it takes more than 1 second for the claw motor to turn to a direction, the program gives up and goes onto the next line. Meaning the program doesn’t get stuck.