Need Help Controlling ESC with Arduino

Below is some servo test code. You should be able to use the serial monitor to send a high servo position like 2000 when needed, and then a low value like 1000 when needed. You will need to do the testing with the ESC, as I only have servos and no ESC to test.

// zoomkat 11-27-10 serial servo test
// type servo position 0 to 180 in serial monitor
// for writeMicroseconds, use a value like 1500
// for IDE 0019 and later
// Powering a servo from the arduino usually DOES NOT WORK.

String readstring; //string to be captured from serial port
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);
  myservo.attach(7);  //the pin for the servo control 
  Serial.println("servo-test-21"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    delay(10);  
    if (Serial.available() >0) {
      char c = Serial.read();  //gets one byte from serial buffer
      readstring += c; //makes readstring from the single bytes
    } 
  }

  if (readstring.length() >0) {
    Serial.println(readstring);  //so you can see the captured string 
    char carray[readstring.length() + 1]; //determine size of the array
    readstring.toCharArray(carray, sizeof(carray)); //put readStringinto an array
    int n = atoi(carray); //convert the array into an Integer 
    myservo.writeMicroseconds(n); // for microseconds
    //myservo.write(n); //for degees 0-180
    readstring="";
  } 
}