Push Button Servo

Hello, Can anyone help me with a piece of code to control a servo motor? I want to press the push button attached on pin 4, then the servo rotate 90 degrees, and the wait 10 seconds before going back to 0 degrees.

Code that seems to be close to what you describe.

//zoomkat servo button test 7-30-2011

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(160);
    delay(2000);
    servo1.write(20);
  }
}

Thank you Zoomkat, I actually just found your code and changed it a little to work for my needs. My new problem is adding the one-wire input 4x4 keypad to unlock the servo as well as this piece of code. Any suggestions?

jrugg8028:
My new problem is adding the one-wire input 4x4 keypad to unlock the servo as well as this piece of code. Any suggestions?

Did you get any example code for using the keypad?
Which keypad - post a link to its datasheet?

...R