Servo on/off with N.O. Momentary button ?

Hello, I am trying to run a hobby servo similar to a windshield wiper motor. I included the servo header file from the library. I have the servo wiping back and forth with two for loops when I start the program. My issue is incorporating a button to initiate the loops and be capable of stoping or possible interrupting them with the same button. Also the button would stop the wipers at any time and return the servo to 0 degrees. Thank you

Basic servo button code.

//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);
  }
  else {
    servo1.write(20);
  }
}

You want a latch.
Check the button state then compare it to an "old" state. If the two states are NOT equal to each other, then have a Boolean variable invert it's state.

ButtonState = digitalRead();
if( ButtonState == HIGH && ButtonState != oldState ) // Minor correction: without declaring ButtonState == HIGH or LOW, the Latch will invert when pressed AND released. 
{
  Latch = !Latch;  // boolean variable changes from HIGH to LOW or LOW to HIGH when pressed.
  oldState = ButtonState;  // update oldState
}

if( Latch == HIGH ) // servo on
else // servo off

Here is a present for you

 #include <Servo.h>

Servo bbServo;
boolean sweeping = false;
const byte buttonPin = 7;
byte servoPosition = 90;
byte servoIncrement = 1;
const byte servoLowLimit = 0;
const byte servoHighLimit = 180;
unsigned long prevServoMoveTime;
unsigned long servoMoveInterval = 20;
byte prevButtonState = HIGH;
byte currentButtonState;

void setup() 
{
  bbServo.attach(8);
  pinMode(buttonPin, INPUT_PULLUP);
}

void loop() 
{
  currentButtonState = digitalRead(buttonPin);
  if ( (currentButtonState != prevButtonState) && currentButtonState == LOW)
  {
    sweeping = !sweeping;
  }
  prevButtonState = currentButtonState;

  if (sweeping)
  {
    if (millis() - prevServoMoveTime >= servoMoveInterval)
    {
      bbServo.write(servoPosition);
      prevServoMoveTime = millis();

      servoPosition += servoIncrement;
      if (servoPosition > servoHighLimit || servoPosition < servoLowLimit) 
      {
        servoIncrement *= -1; 
        servoPosition += servoIncrement;
      }
    }
  }
  else
  {
    servoPosition = servoLowLimit; 
    bbServo.write(servoPosition);
  }
}

I don't usually post whole solutions but I have seen a couple of painful threads recently where the OP was offered advice but could not seem to apply the advice to the problem they were having. To prove that you understand how the program works, after changing pin assignments to match your hardware, please add comments to the code and post it back here.

NOTE that the program depends on the button being wired so that when pressed the button pin is taken low.

I will give this code a try and analyze what was done. I will repost back!