Skip to content

Instantly share code, notes, and snippets.

@crispinha
Last active February 12, 2018 23:25
Show Gist options
  • Save crispinha/bcf77a20bcd5b1a21599ac46d854b524 to your computer and use it in GitHub Desktop.
Save crispinha/bcf77a20bcd5b1a21599ac46d854b524 to your computer and use it in GitHub Desktop.
hack_the_planet
void press_and_release(long key) {
Keyboard.press(key);
delay(100);
Keyboard.release(key);
}
void setup() {
const int ledPin = 13;
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
Keyboard.press(MODIFIERKEY_GUI);
Keyboard.press(KEY_R);
Keyboard.release(MODIFIERKEY_GUI);
Keyboard.release(KEY_R);
delay(100);
press_and_release(KEY_BACKSPACE);
Keyboard.print("cmd");
delay(100);
press_and_release(KEY_ENTER);
delay(100);
Keyboard.print("cd C:\\");
delay(100);
press_and_release(KEY_ENTER);
delay(100);
Keyboard.print("tree");
delay(100);
press_and_release(KEY_ENTER);
digitalWrite(ledPin, HIGH);
}
void loop(){}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment