View Single Post
  #2   Spotlight this post!  
Unread 10-02-2007, 19:21
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Getting the camera to work in autonomous

Kevin's camera state handler (Camera_Handler(), I believe) wants to be called in the "slow loop" (every 26.2 ms). It counts how many times it has been called to determine how long it has been to determine if a time-out condition has occurred. Make sure your code is calling Camera_Handler() only when there is new data:
Code:
  while (autonomous_mode)   /* DO NOT CHANGE! */
  {
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {
        Getdata(&rxdata);   /* DO NOT DELETE, or you will be stuck here forever! */

        /* Add your own autonomous code here. */
        Camera_Handler();
        Servo_Track();
        ///////////////////////////////////////////
        //Add whatever code you want here.//
        ///////////////////////////////////////////
        Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

        Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
    }
  }
Also, uncomment the #define for _DEBUG in camera.h and see what you get in the terminal window when you turn on auton. You should see either the initialization like you would in user mode, or tracking packets (that might only apply to Kevin's "Bells and Whistles" version; not sure).

JBot
__________________
Aren't signatures a bit outdated?

Last edited by JBotAlan : 10-02-2007 at 19:23.