I am having trouble with my vision sensor code. It is meant to find the red color of the goal, and orient it to face to the goal:
void Aim(){
Vision.takeSnapshot(Vision__VEXRED);
if(Vision.objectCount > 0){
//Implementation not shown
} else {
//Re-aim
Controller1.Screen.clearScreen();
Controller1.Screen.setCursor(1,1);
Controller1.Screen.print("Unable to detect object");
}
}
The specific problem is that it keeps going into the else part of the code, not detecting any objects. It just keeps going printing to the screen “Unable to detect object”. I have set up VEXRED in the vision sensor, so I’m not sure what’s causing this.