|
#3
|
|||||
|
|||||
|
Re: fidget?
to clarify that last post, you want to slowly change the command you're sending to the motors. So you take advantage of the fact that pwm values can stay the same from one cycle to the next and say something like:
if (pwm01 < pwm01_cmd) { pwm01 += ACCEL; } The point being you add a little more to the pwm command every time through the loop till it's where you want it. Now, you still have to set up the decresing side, and you need to check for special cases like if your ACCEL value is 5, pwm01= 202 and pwm01_cmd = 205. Then you'd wobble back and forth from 202 to 207 to 202 to.... |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|