Alright, so I have fixed my StartEncoder functions to eliminate the window in my logic and I placed those function definitions in User_Routine_Fast. I actually want the effect of this function to happen during user control, so I have the call to StartRightEncoder() placed in User_Routine.
I placed all function definitions right before
Code:
void Process_Data_From_Local_IO(void)
After compiling all of this and running it, it still doesnt work as intended. If the motor is ran slowly (pwm = 154) then it goes about a quarter of a turn too far. However, if I put it at 255, it goes about three times too far (this is with the wheel coming directly off the motor).
I suspect that I am still not polling fast enough (due to the fact that I dont actually have anything in Process_Data_From_Local_IO) but when I placed my function definitions in Process_Data_From_Local_IO, I recieved a whole bunch of errors.
When I placed my call to StartRightEncoder() in Process_Data_From_Local_IO, I got a very odd pulsing of the motors (meaning they would run for a second, stop for a second, and then continue on in that pattern) when combined with the function
Code:
if(GetRightTick() <= 180)
{
pwm04 = 255;
}
Thanks for your help Mark, I know I ask a lot.