Stopping all processes in PROS

Hello,
I’m trying to create a “panic” button for my robot that ends or pauses all tasks. Is there a function for doing this?

One: I don’t know
Two: why would you need this?

For debugging, if something goes catastrophically wrong, you can stop the robot easily.

I made something similar for my bot in opcontrol():
"
while (1) {
trigger = false
if buttonpressed
trigger =true
if anotherButtonPressed
trigger = false
if trigger {
//regular driver control stuff
}
}
"
This isn’t exactly what you asked for, but it may work as a simple solution

Edit: taskDelete() in pros when you pass nothing will delete the current task (stopping the robot if you’re in the main task). This is from the Cortex documentation but I’m sure a similar function will exist in v5

So that if something goes terribly wrong with my robot software wise during development I can stop the robot from potentially damaging itself.

A long press (1-2 seconds) on the center button of the controller will stop any running program and return control to VEXos, regardless of what you wrote the program with or what competition state the robot is in. (So long as the controller has a connection to the robot, of course.)

2 Likes

You’d have to write code that calls task_suspend(my_task); for all your tasks.

2 Likes