Quote:
|
Originally Posted by TedP
Additionally, someone's mentioned how you should put the Generate_Pwms in autonomous mode as well before the Putdata call. You might think about replacing the whole thing with Process_Data_From_Local_IO, and now that I think about it, you should probably put that P_D_F_L_IO outside the slow if( statusflag... ) block. That way you'll be able to respond to robot sensors much more quickly in the exact same fashion as you respond to sensors in non-autonomous mode.
|
It makes sense to call Process_Data_From_Local_IO() inside the
while loop but outside the
if (statusflag.NEW_SPI_DATA) block. But you should
not be calling Generate_Pwms() in the fast loop -- the PIC PWM outputs get a little squirrely if you write to them too quickly.