I want to loop through an array of my vision sensor colors, but auto doesn’t work. What type are they?
Can you post what code you have now? The objects on the array are vision::object I think. I recommend extracting the desired value(centerX centerY etc) from the vision array and sticking it into a different array. I am currently attempting to make something similar right now for vision tracking the goal.
Thank you. I don’t have my code right now, but I can post an idea. Do you use triple quotes for code?
Got it.
auto colors[2] = {BLUEY, REDY};
for (color : colors) {
Vision.takeSnapshot(color);
Brain.Screen.print(Vision.largestObject.originX);
Brain.Screen.print(Vision.largestObject.originY);
}
Actually, it’s vision::signature.
vex::vision::signature colors[2] = {BLUEY, REDY};
for (auto item : colors) {
Vision.takeSnapshot(item);
int x = Vision.largestObject.centerX;
int y = Vision.largestObject.centerY;
Controller1.Screen.print("x-value:");
Controller1.Screen.print(x);
Controller1.Screen.print(" y-value: ");
Controller1.Screen.print(y);
}