How do you get servo position in arduino?

servo.read() method returns the last position value written to the servo. This may not the same as the actual position. The Servo.attach() method lets you specify minim and maximum values for the positioning commands and these can be changed to adjust the relationship between the commanded positions and actual position.

Bear in mind that many servos will not mover over a full 180 degrees and that the servos can take a signficant fraction of a second to move over their full travel/ The read value will not indicate the actual position if the servo is moving

1 Like