We hooked up our sensors, and use Kevin's ADC code to pull them.
Then we check for new adc data in the Process_Data_From_Local_IO() function in user rutines fast.
That is all fine and well (as in, it works exacly like it should).
We recently started to mess around with the autonomus mode, and our debug messages show us that sensor data isn't being updated while we set the autonomus button. when we unset it, the sensor data does gets updated.
We checked and Process_Data_From_Local_IO() isn't even called.
Code:
while (1) /* This loop will repeat indefinitely. */
{
#ifdef _SIMULATOR
statusflag.NEW_SPI_DATA = 1;
#endif
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{ /* I'm slow! I only execute every 26.2ms because */
/* that's how fast the Master uP gives me data. */
Process_Data_From_Master_uP(); /* You edit this in user_routines.c */
if (autonomous_mode) /* DO NOT CHANGE! */
{
User_Autonomous_Code(); /* You edit this in user_routines_fast.c */
}
}
Process_Data_From_Local_IO(); /* You edit this in user_routines_fast.c */
/* I'm fast! I execute during every loop.*/
} /* while (1) */
There is no aperent reason for the autonomus code and mode to affect the runing of the main loop, but for some reason it does.
HELP!!!
__________________
My FRC record: 10 Years,FTA (2008-9), 3 Teams(1947,2669,3211).3 RCA, 1 Championship EI(2016), 1 Divisional finalist (2016), 1 Regional winner.
Israeli 2016 Volunteer of the year.