how to change default position of servo to the center

hey there, i am new in using arduino and also i don't have much pretty knowledge about coding. i started just 5 days ago so anyone can please help me how to change the default position of servo to the center .i have tower pro micro servo ... and after changing the position to the center, how to stop it at extreme left/right using a button ....because i dont know to stop and it loops like wiper of car please help :)

Your question is not very clear.

If you want to start the servo at the centre position you could put Servo.write(90); into setup();

If that is not what you have in mind please post your program and another explanation.


You can edit this line in servo.h, but the centre is the default, or at least 1500us is, which is usually the centre.

#define DEFAULT_PULSE_WIDTH  1500     // default pulse width when servo is attached