Thread: Autonomous Mode
View Single Post
  #3   Spotlight this post!  
Unread 05-02-2007, 19:00
fallen751 fallen751 is offline
Registered User
FRC #2052
 
Join Date: Jan 2007
Location: Minnesota
Posts: 17
fallen751 is an unknown quantity at this point
Re: Autonomous Mode

hi! I put servo_track(), and camera_handler() in the autonomous code

Code:
 while (autonomous_mode)   /* DO NOT CHANGE! */
  {
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {

	Getdata(&rxdata);
	Camera_Handler();
	Servo_Track();


	// Turn on the "Switch 3" LED on the operator interface if
	// the camera is pointed at the green light target. The
	// Switch3_LED variable is also used by the Default_Routine()
	// function below, so disable it inside Default_Routine()
	// if you want to keep this functionality. 
	if(Get_Tracking_State() == CAMERA_ON_TARGET)
	{
		Switch3_LED = 1;
	}
	else
	{
		Switch3_LED = 0;
	}

        /* Add your own autonomous code here. */
		if(Get_Tracking_State() == CAMERA_ON_TARGET)
		 {

			static char oldpwm01, oldpwm02, oldpwm03, oldpwm04;
			int slowpwm01, slowpwm02, slowpwm03, slowpwm04;
yet, still no camera searching while in autonomous mode! any help is much appreciated. we plug a wire between pins 8 and 5 to activate autonomous mode on our control - and it seems to work fine, so I don't think its an issue on that side. however, any autonomous code I put in doesn't seem to be read by the control - like if I started autonomous with a pwm01 = 254 the first victor light would still be orange. thanks!

p.s. why does the autonomous mode need to be a large while loop? isn't it checked every cycle of the main function? so wouldn't it be easier to leave the up_master_data stuff out and just run autonomous from main.c

Last edited by fallen751 : 05-02-2007 at 19:06.