adjusting servo libary in arduino 022

hi there

I am trying to adjust the acceleration and speed of my servo rotation in the servolibary of arduino 022
I am looking for these values:

#define MAX_ACCEL 1 //1-16 seems sensible
#define SLOW 7 //7-16 seems to work ok

but I cannot find them, is there a new servolibary in 022?
and how can I adjust the acceleration in that libary? I am trying to make my servo accelerate in a curve
so it'll be more precise, at the moment it keeps correcting itself, cus there is quite a lot of weight on it

is somebody knows.... thanks allready!


I don't recall any such parameters in the standard libraries - which version IDE are you using?

at the moment; 022
before I was using 018 I think

No, not in the standard servo library in 0018 - I've got it right in front of me here.

hmm odd...

but do you know how to adjust acceleration and speed in the servolibary in 022?

You can't adjust speed and acceleration of a servo with the library. You feed it a new position and it goes there as fast as it can.

If you want slower motion in your servo you can move it a degree (or microsecond) at a time as infrequently as you like. The servo.write() will give you about 181 steps end-to-end (0 to 180) and the servo.writeMicroseconds() will give about 1000 steps end-to-end (1000 to 2000). Write a loop to step by degrees (or microseconds) and put in a delay to adjust the rate.

One of the members (forget who) posted a library a couple of weeks back that had this property.
Or maybe it was a version where you gave the time a particular angular displacement should take, and the library took care of it.
Either way, this is not and has not been a standard feature.

thanx all!
i'll try that on the speedpart

but I understand there is now way to accelerate in a curve?

If you break the move down into little steps, and the time between steps varies, the motion will appear to accelerate and decelerate with how often you change the position. You just need to calculate how long you want to wait between each of the (many) waypoints.

jep I understand, gonna try that

anybody knows who posted that libary? cant find it on the form…

thnx a lot guys!


the below may be what you are looking for. Search tip: use google advanced search to look for things in this forum, much better than the forum search feature.

thanks all!
thanks a lot for the info!

great, wouldnt know what I'd do without you guys!