|
Re: Lag Issue
Look at your ramp functions. You need to rethink how you're doing that. Once you enter a loop, your program has to wait for it to finish before it can continue on, thus you get delays. Try, instead, to maintain a state variable that represents the current PWM input. Your joy values represent the desired PWM input.
psuedo code:
If pwmDesired > pwmActual then pwmActual += 2;
If pwmDesired < pwmActual then pwmActual -=2;
Add in some approprate limits etc. and it should react more quickly to user input.
|