View Single Post
  #6   Spotlight this post!  
Unread 16-01-2006, 12:18
amateurrobotguy's Avatar
amateurrobotguy amateurrobotguy is offline
Lead Programmer/Senior Engineer
no team
 
Join Date: Feb 2005
Rookie Year: 2000
Location: ****
Posts: 136
amateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these partsamateurrobotguy is infamous around these parts
Re: Need a little help with how to break out of the box

Again, thank you for the help
Quote:
No that wont work because it will only execute the auton once for a fraction of a second (26.2 ms to be exact) because the next time the automationhasrun = 1 so it wont run again;
DON'T DO THIS BECAUSE YOU DON'T HAVE CONTROL OVER IT.
But if I did use the variable, wouldn't it ensure that the subroutine just runs 1 time and never again until the robot is powered on? If I wanted a subroutine to run just one time in default_routines, would this need be used?

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. */

        Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

        Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
    }
  }
Like here won't it continuously loop the Auto code(An any subroutines in it) until it realizes 'hey, I am not in auto mode anymore'?

And what does the generat_pwms part do? Aren't they already initialized?
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).