how to control of servo motor degree with variable frequency

Hi, my project control of servo motor. when the frequency 50 Hz the servo on zero degree , when the frequency more than 50 Hz the servo turn to right but when the frequency less tan 50 Hz the servo motor turn to left. please I want code of arduino
thank you very much

Have a look at pulseIn() to measure the frequency. Then convert the pulse time into frequency (1/time) and finally into the right value for the servo.

walsh_aliy34:
Hi, my project control of servo motor. when the frequency 50 Hz the servo on zero degree , when the frequency more than 50 Hz the servo turn to right but when the frequency less tan 50 Hz the servo motor turn to left.

Alternatively, to avoid 'blocking' code, if you need to also do other stuff as well, use an interrupt to detect the rising or falling edges and time the period between them.

please I want code of arduino
thank you very much

No one will write it for you. We'll help you write it, but you have to make a start yourself.

You first need to work out the range of frequencies, and how far you want the servo to move relative to the change in frequency.