I have code my robot to go through a challenge that picks up soda cans. My V5 robot will run the coding but then stop at my last drive train block for 46 inches forward. The robot will not continue to run the final codes, it will just stop. Does anyone have an idea on what I should do?
The code snippet you posted shows the “46 inches forward” block as the last one (no “final codes”). Is it executing this command or stopping just short of it?
All of your motion commands have the default option of waiting for full execution before moving on to the next command. (this is the small white triangle at the end of each block that points to the right. If a command to the claw or arm motor cannot be fully executed because there is a physical limtation preventing the full range of motion requested (i.e. the claw can not spin all the way to 170 beacsue the claw has reached it limits), then the code can not move on to the next block. The program is on hold until the motor reaches the correct position - which it never does.
To check if this is the problem, change the last working motion block to be “and don’t wait”.
If that allows the code to move on, re-evaluate the values you are asking the motors to move to. While selecting the “and don’t wait” option may solve the problem, the motor in question will still be trying to reach the unobtainable position. You will need to fix the values on the code so you do not drain battery life and/or damage the motor.
Yup, the most common problem is something stopping the robot from moving to said position. Check if anything is blocking the robot from moving forward 46 inches