Thread: Finding color
View Single Post
  #2   Spotlight this post!  
Unread 20-02-2005, 03:23
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Finding color

Alrighty heres what I would do.
In user_routines_fast.c

at the beginning
Code:
int counter=0;
int tracking_green=0;
In the autonomous section
Code:
#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.