When I start up the code for my Vision Sensor it reads that it detects the color but doesn’t activate the if else statement. Other students in my class are having the same problems and we have switched brains vision sensors and re written code. here is the code.
event checkBlue = event ();
void hasBlueCallback(){
Brain.Screen.setFont(mono40);
Brain.Screen.clearLine(1,black);
Brain.Screen.setCursor(Brain.Screen.row(),1);
Brain.Screen.setCursor(1,1);
Vision.takeSnapshot(Vision__BLUEBOX);
if (Vision.objectCount > 0){
Brain.Screen.print(“Anomoly Found”);
wallMotor.spinToPosition(500,degrees);
} else {
Brain.Screen.print(“No Anomaly found”);
}
}
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
checkBlue(hasBlueCallback);
Motortred.spin(forward);
}