when my vision sensor sees the blue ball I set up for it to look for when it sees it spits it out of the robot but the problem is that the robot freezes and I cant do anything then a couple of seconds later all the commands that I did in the time it was still it dose them at this time
I believe this is because you’re waiting 0.75 seconds; doing this pauses the entire driver control function until the code has waited for that duration.
The better solution here is to remove the vision sensor loop from the main driver task. Starting another task to constantly check the vision senor would be the better option. That way you can still have delays in that loop. Putting driver control code inside the loop would not remove the problem of the wait command inside of the loop.
For our team, we still use a wait command but ours is only 20 milliseconds and this seems to work well. We also draw a rectangle on the screen of what the sensor sees and this helps give us a visual.
I use Vex V5 Text, but this code may give you an idea of what we use:
Brain.Screen.clearScreen();
Brain.Screen.setOrigin(1, 1);
Brain.Screen.drawRectangle(0, 0, 316, 212);