Help me with functions

I need to call a function and then continue
I call an emergency stop function at the top of auton (competition template) and continue through the code while my emergency stop function checks my emergency stop switch and if pressed, it does the code: while(true){allmotorsoff();SensorValue[ERR_IND]=1;}

Sounds like you need some threading. Assuming you are still using robotc from last question, call the function like this:
startTask(emergencystop);

and then in the auton you’ll need to check with a global variable if your emergency stop has been triggered.

http://www.robotc.net/forums/viewtopic.php?t=7699&p=28272

3 Likes

will the task run as soon as it is declared like task main() or will it wait for a “starttask(emergencystop)” before it starts?

EDIT: never mind
it warns me with unreferenced task