  
  This sketch demonstrates the Keyboard library.
  
- When you connect pin 12 to ground, it creates a new
+ When you connect pin 2 to ground, it creates a new
  window with a key combination (CTRL-N),
  then types in the Blink sketch, then auto-formats the text
  using another key combination (CTRL-T), then 

  Keyboard.println("1000);");
  Keyboard.println("digitalWrite(13, LOW);");
  Keyboard.println("delay(1000);");
  // tidy up:
  Keyboard.press(KEY_LEFT_CTRL);
  Keyboard.press('T');
  Keyboard.releaseAll();
  delay(3000);
  // upload code:
  Keyboard.press(KEY_LEFT_CTRL);
  Keyboard.press('U');
  Keyboard.releaseAll();

  // wait for the sweet oblivion of reprogramming:

 
 http://www.arduino.cc/en/Tutorial/KeyboardReprogram
 */

// use this option for OSX:
char ctrlKey = KEY_LEFT_GUI;
// use this option for Windows and Linux:
//  char ctrlKey = KEY_KEFT_CTRL;    


void setup() {
  // make pin 2 an input and turn on the 
  // pullup resistor so it goes high unless
  // connected to ground:
  pinMode(2, INPUT_PULLUP);
}

void loop() {
  while (digitalRead(2) == HIGH) {
    // do nothing until pin 2 goes low
    delay(500);
  }
  delay(1000);
  // new document:
  Keyboard.press(ctrlKey);
  Keyboard.press('n');
  delay(100);
  Keyboard.releaseAll();
  // wait for new window to open:
  delay(1000);

  // Type out "blink":
  Keyboard.println("void setup() {");
  Keyboard.println("pinMode(13, OUTPUT);");
