How to make Servo go 50 degrees, back to 0 degrees then go 50 degrees other way

Hello everyone,

I am a newbie to arduino and I was wondering if someone could explain to me how to make a servo go 50 degrees one way then go 50 degrees the other way. I've been trying to google an answer although I can only find ways to make it go clockwise.



The Sweep example does nearly exactly what you describe unless what you have is not a servo and has been converted to a continuous rotation (not really a)servo

Can you provide a link to the servo that you are using ?

Or use the Knob example, add a Serial.println(val) and make a note of what numbers in the write() move the servo to where you want it.

It should be something like write(90) to centre then write(90+50) for 50 degrees one way and write(90-50) for 50 the other way but those numbers will need calibrating for the particular type of servo you're using.