Controlling CR Servos using Keystrokes

I have a Continuous Rotation Servo and a Mega 2560. What I want to do is get that Servo spinning for 5seconds when I press "a" on the keyboard. Is this possible? Any help on the programming?

Thank You in Advance!

Yes, it's possible. Read about the servo library on the reference page. It explains how to control continuous rotation servos.

You can either use delay() to get the servo to rotate for 5 seconds, or look at the 'blink without delay' example to learn how to do it in a more flexible way.

Below is some simple button code you can experiment with.

//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(80);
    delay(5000);
    servo1.write(90);
  }
}