I have had the same problem. I also tried.
Code:
if (StartCameraTask(10, 0, k160x120, ROT_0) == -1){
printf("Failed to spawn camera task: %s\n",GetVisionErrorText(GetLastVisionError()));
}
// Set up camera tracking parameters.
tdata = GetTrackingData(GREEN, PASSIVE_LIGHT);
tdata.hue.minValue = 67;
tdata.hue.maxValue = 114;
tdata.saturation.minValue = 161;
tdata.saturation.maxValue = 255;
tdata.luminance.minValue = 24;
tdata.luminance.maxValue = 101;
in the init with
Code:
ParticleAnalysisReport par;
if (FindColor(IMAQ_HSL, &tdata.hue, &tdata.saturation, &tdata.luminance, &par)
&& par.particleToImagePercent < MAX_PARTICLE_TO_IMAGE_PERCENT
&& par.particleToImagePercent > MIN_PARTICLE_TO_IMAGE_PERCENT) {
int lightX = (int)(par.center_mass_x_normalized * 1000.0);
int lightY = (int)(par.center_mass_y_normalized * 1000.0);
printf("Light found: x: %i y: %i\n", lightX, lightY);
} else {
if (err)
printf("Failed to spawn camera task: %s\n", GetVisionErrorText(GetLastVisionError()));
else
printf("light not found\n");
}
in the main loop but that didn't work either