Position Feedback Servo?

Is there a code to record the steps of a servo if i rotate it manually?

if so, could anyone help me with this please?

No, not with a normal hobby servo. You'd need a special servo that provides feedback and then you'd need some special code to record what was happening and you'd have to hope that manually turning the servo didn't damage it.

Feedback servos do exist but there are not many few of them about e.g. Pololu - FEETECH FS90-FB Micro Servo with Position Feedback


Thread split as requested.

A simple hobby servo usually has a potentiometer measuring the position of the servo horn for its own controlling circuit. You can hack into such a servo and locate the internal pin going to the sweeper of the potentiometer. Attach it to an analog input on your Arduino. Now you have a feedback from your servo. But don't just do it following this simple advice. Google for projects how people have done it. There might be things to consider, something I haven't mentioned.