Finding color

Hey, i’ve had no luck with the camera so far at all…all i want to do is have a code in autonomous that just finds green and returns a 1…the camera doesn’t even have to move…it can just stand still…but just finding a color is posing trouble for me…if someone could give me a sample code…or what function i need to run and how that would be appreciated

Alrighty heres what I would do.
In user_routines_fast.c

at the beginning


int counter=0;
int tracking_green=0;

In the autonomous section


#if _use_CMU_Camera
if(counter=0)
  {
  camera_init(x,y,z);
  auto_servo(0);
  camera_find_color(GREEN);
  counter++
  }

if (camera_track_update()=1 && cam.size > 0)
  {
  tracking_green=1;
  }
else
  {
  tracking_green=0;
  }
#endif

then later you just have to check the value of tracking_green. Oh and remember to plug in your calibration values in that camera_init(x,y,z) function.