VexCode IQ Blocks with DriveTrain and Gyro issue

There seems to be an issue with the VexCode IQ Blocks. I have a simple DriveTrain with Gyro configured along with a touch LED and a Bumper. I have the code so that when I touch the touch LED, that the robot moves forward a certain number of distance and displays “Done”. If at any time, the bumper is pressed, then the drive stops.

This works if I don’t hit the bumper in the middle of driving. I can keep on hitting the touch LED over and over again and it will work. However, if I hit the bumper in the middle of driving, the touch LED thread gets stuck because it’s still waiting for it to move the complete distance. Therefore, I can not hit the touch LED again to get it to start working.

I’ve verified that if I manually move my robot to the right distance, I get the “Done” message and I can hit the touch LED again.

Is there any way to fix this?

Can you post your code???


You need to do this a little differently. Here is the help block. I don’t think it works with a drive command.


I would like to use a waitunil the drive reaches a certain number of rotations, but under the sensing I don’t see a way to do that.

Thanks @sankeydd. So what’s the point with the drive forward for “10 inches” ? You have to time things to know the distance? Also what about turning? Turn right for 90 degrees. Do I need to time the turns too? It seems to me, there needs to be a way to break out of an event thread.

This would stop the driving until 5 turns of the wheel or if you push the EUp button. You could add in additional blocks in the OR to include as many conditions as you want. Simply nest the ORS until you have the desired number of spots.



1 Like

Thanks again for your help. Your post helped me. I implemented it in a way that works at any time you can interrupt the robot.



This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.