Facebook
From Wet Flamingo, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 245
  1.         int RXLED = 17;  // The RX LED has a defined Arduino pin
  2.         const int buttonPin = 2;     // the number of the pushbutton pin
  3.         int buttonState = 0;         // variable for reading the pushbutton status
  4.  
  5.  
  6.         #include "Keyboard.h"
  7.          
  8.         void typeKey(uint8_t key)
  9.         {
  10.           Keyboard.press(key);
  11.           delay(50);
  12.           Keyboard.release(key);
  13.         }
  14.          
  15.         String sciezkazapisu = "%USERPROFILE%\hotdog.jpg";
  16.          
  17.        
  18.          
  19.         /* Init function */
  20.         void setup()
  21.         {
  22.  
  23.          // initialize the LED pin as an output:
  24.  pinMode(RXLED, OUTPUT);  // Set RX LED as an output
  25.   // initialize the pushbutton pin as an input:
  26.   pinMode(buttonPin, INPUT);
  27.        
  28.         }
  29.          
  30.        void loop() {
  31.   // read the state of the pushbutton value:
  32.   buttonState = digitalRead(buttonPin);
  33.  
  34.   // check if the pushbutton is pressed.
  35.   // if it is, the buttonState is HIGH:
  36.   if (buttonState == HIGH) {
  37.     // turn LED on:
  38.     digitalWrite(RXLED, HIGH);
  39.    
  40.  
  41.      Keyboard.begin();
  42.           delay(500);
  43.           delay(3000);
  44.           Keyboard.press(KEY_LEFT_GUI);
  45.           Keyboard.press('r');
  46.           Keyboard.releaseAll();
  47.           delay(100);
  48.           Keyboard.print("iexplore http://s3.amazonaws.com/rapgenius/hotdog.jpg");
  49.           Keyboard.press(KEY_RETURN); //enter
  50.           delay(100);
  51.           Keyboard.press(KEY_LEFT_CTRL);  //zapisywanie
  52.           Keyboard.press('s');
  53.           Keyboard.releaseAll();
  54.           Keyboard.end();riexplore http://s3.amazonaws.com/rapgenius/hotdog.jpg
  55.        
  56.          
  57. }
  58.  
  59.   else
  60.   {
  61.     // turn LED off:
  62.     digitalWrite(RXLED, LOW);
  63.  
  64.  
  65.    
  66.   }
  67. }
  68.  
  69.  
  70.  
  71.          
  72.                        
  73.