Here is my code for my color sort, I am curious on how to make it run in the background for autonimous.
void redColorSort(){
bool redBall;
float newHue=Optical20.hue();
//std::cout<<newHue<<endl;
if(newHue<=35 && newHue>= 0){
redBall=true;
FullIntake9.spin(reverse, 100, pct);
Half8.spin(reverse, 100, pct);
Half10.spin(reverse, 100, pct);//spin scoring motors
}
if(newHue<=200 && newHue>= 160){
redBall=false;
FullIntake9.spin(reverse, 100, pct);
Half8.spin(reverse, 100, pct);
Half10.spin(fwd, 100, pct);//spin wrong motors
}
}