PWM Servo Feedback (I2c) icon PWM Servo Feedback (I2c) — Real-time servo position input via Arduino ADC over I2C; supports Nano (6 channels) or Mega (16), configurable I2C address and scalable chaining. Try it →
 

Getposition

Servo.getPosition(port, [ezbIndex])

Parameters

port Servo port to use.
ezbIndex (optional) Board index of the EZB to use.

Returns

The commanded position of the servo at the specified port as a value between 1 and 180.

Description

Returns the position of the servo at the specified port as a value between 1 and 180. This function only returns the position the servo was commanded to move to, not the actual position of the servo. This does not query a bi-directional servo to get the position. It only returns the last position the servo was moved to.

If you wish to get the servo position of a smart servo, use the getPositionRealtime() command