How to use taskCreate in PROS

Hello everyone! Been a while.

I’m coding the program for my vex team’s robot for next school year, and I’m using PROS. I have a question about the taskCreate() function. So I made a function like so:


taskCreate(WriteValues,5, TASK_PRIORITY_DEFAULT);

It comes up with an error saying “too few parameters”.
It says in the doc that it is supposed to have four parameters, but I do not understand what the stackdepth and parameters fields are for. Does anyone here know?

Thanks,
brep

Relevant documentation: Purdue Robotics Operating System: include/API.h File Reference


taskCreate(WriteValues, TASK_DEFAULT_STACK_SIZE, NULL, TASK_PRIORITY_DEFAULT);

The stack size is how much of the stack (memory) will be allocated to use within the task. Just think of it as how many variables you can create inside the task. Just use the default size for now.

The parameters are anything that you would like to pass in as arguments. Think of it as the parameters to a function. Since you aren’t passing anything in, you can use NULL.

Thank you! I understand how to use it now.