Re: Need a little help with how to break out of the box
The subroutine is right but you have to put a function prototype in the user_routines.h
ex. void Automation(void); like the others already there
Now place this subroutine below all others in user_routines.c
Then call it like inside the function, void Process_Data_From_Master_uP(void)
and comment out the Default_Routine()
ex. (to allow you to control when the auton on and off)
if(p1_sw_trig==1)
Autonomous();
else
Default_Routine();
//basicly you have to hold the trigger to execute the auton.
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.
The trigger control above will let you control the running of the auton.
|