My team has had problems during autonomous in multiple occasions with picking up the wrong color rings. I believed that we could fix this with a optical sensor and a color sort. This method works 99% of the time and I have a perfect program for driver control. However, during autonomous, I cannot find a way to constantly check the color input of the ring. After asking local teams, I have determined that tasks have been a successful way of using color sort. Throughout my research on tasks, I have only determined what they do and not how to program them. Does anyone have a piece of example code for how to program a task? Or any experience or Advice? On another way to program color sort?
Here is another thread that might answer your question.
Basically, if you are using PROS it’s as simple as:
Task task_name{[=] {
// This is the new thread/task
// Call a function that will run a loop and repetitively check if the wrong color ring is in the intake.
function();
}};