Go Down

Topic: Servo - convert writeMicroseconds to write angle (Read 788 times) previous topic - next topic

S_Flex

Does anyone know the math  to figure out how to get the servo write() angle out of the writeMicroseconds number?

Thank you in advance! ^^

PaulS

Quote
Does anyone know the math  to figure out how to get the servo write() angle out of the writeMicroseconds number?

Why do you need to? The process is exactly the same as mapping from angle to microseconds, except that the ranges are swapped.

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

retrolefty

And in reality the servo library mapping is a crude assumption on the part of the servo library because it assumes all servos have the same physical positioning range using the same minimum and maximum pulse width values, which is simply not the case.

If one wants servo.write(degrees) to accurately move the servo in real degree steps then they must carefully test their specific servo(s) and supply the servo library with the correct minimum and maximum pulse widths and build their own mapping to the physical travel limits for the servos being used. servo.writeMicroseconds() is your friend to gain the information needed to have well characterized servo movements possible in your projects.

Lefty

Go Up