View Single Post
  #3   Spotlight this post!  
Unread 17-12-2003, 10:17
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Autonomous modes?

Quote:
Originally Posted by Buster
Looking for an autonomous code to use as a test. please reply ASAP
/************************************************** *******
* FUNCTION NAME: Sample_Auto_1
* PURPOSE: Primitive form of autonomous mode program
* This overrides the PWM joystick inputs
* CALLED FROM: user_routines.c, Default_Routine
* ARGUMENTS: none
* RETURNS: void
************************************************** *******/
void Sample_Auto_1(void)
{
static unsigned int counter=0;

/* Sample primitive autonomous mode
* This uses a counter of the number of slow loops as a measurement for how long
* to execute any of the PWM overrides below.
* Note: A timer can also be used in place of "counter"
*/

if (counter<100){
counter++;
PWM_in1 = 200;
PWM_in2 = 200;
}
else if(counter< 150){
counter++;
PWM_in1 = 127;
PWM_in2 = 10;
}
else if(counter< 500){
counter++;
PWM_in1 = 127;
PWM_in2 = 127;
}
else if(counter<700){
counter++;
PWM_in1=254;
PWM_in2=1;
}
else if(counter<900){
counter++;
PWM_in1=1;
PWM_in2=127;
}
else /* Make sure it always stops at the end */
{
PWM_in1 = 127;
PWM_in2 = 127;
}

} /* End Sample_Auto_1 */
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle