From c95c262fe3ade3b8bd5e73671185ccb3a220948a Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Tue, 6 Mar 2012 09:40:22 -0500 Subject: [PATCH] Removed KeyboardSleep example --- .../KeyboardSleep/KeyboardSleep.ino | 80 ------------------- 1 file changed, 80 deletions(-) delete mode 100644 build/shared/examples/9.Keyboard/KeyboardSleep/KeyboardSleep.ino diff --git a/build/shared/examples/9.Keyboard/KeyboardSleep/KeyboardSleep.ino b/build/shared/examples/9.Keyboard/KeyboardSleep/KeyboardSleep.ino deleted file mode 100644 index 2ba615992..000000000 --- a/build/shared/examples/9.Keyboard/KeyboardSleep/KeyboardSleep.ino +++ /dev/null @@ -1,80 +0,0 @@ -/* - Keyboard wake-on-interrupt - - This sketch demonstrates the Keyboard library. - - With most operating systems, when the computer is in sleep mode, - tapping the space bar will wake it up. This sketch puts your - computer to sleep, waits ten seconds, then wakes it up. - - - Circuit: - * Arduino Leonardo - * wire to connect D12 to ground. - - created 5 Mar 2012 - by Tom Igoe - - This example is in the public domain - - http://www.arduino.cc/en/Tutorial/KeyboardSleep - */ - -// give the operating systems numbers: -#define OSX 0 -#define WIN7 1 -#define WINXP 2 -#define UBUNTU 3 - -int plastform = OSX; // change this to match your platform - -void setup() { - // make pin 12 an input and turn on the - // pullup resistor so it goes high unless - // connected to ground: - pinMode(12, INPUT_PULLUP); -} - -void loop() { - while (digitalRead(12) == HIGH) { - // do nothing until pin 12 goes low - delay(500); - } - - //Put the computer to sleep: - switch (platform) { - case OSX: - Keyboard.press(KEY_LEFT_GUI); - Keyboard.press(KEY_LEFT_ALT); - Keyboard.press(KEY_F12); - Keyboard.releaseAll(); - break; - case WIN7: - Keyboard.press(KEY_LEFT_GUI); - Keyboard.press(KEY_RIGHT_ARROW); - Keyboard.press(KEY_RETURN); - Keyboard.releaseAll(); - break; - case WINXP: - Keyboard.press(KEY_LEFT_CTRL); - Keyboard.press(KEY_LEFT_ALT); - Keyboard.press(KEY_DELETE); - delay(1000); - Keyboard.type('S'); - Keyboard.type('H'); - break; - case UBUNTU: - // ubuntu keystrokes? - - break; - } - // wait ten seconds, then wake the computer back up: - delay(10000); - Keyboard.type(' '); - - // wait forever: - while(true); -} - - -