아두이노

아두이노 키보드

모카쨩 2021. 8. 28. 17:18

 

 

키코드 : https://www.arduino.cc/reference/en/language/functions/usb/keyboard/keyboardmodifiers/

 

 

Due에서 사용가능

 

#include <Keyboard.h>
void setup() {
  
  Keyboard.begin();
  Serial.begin(9600);
  Serial.println("Start Arduino");
}
void KeyboardPressHuman(char key) 
{
    Keyboard.press(key);
    Serial.println("Press");
    delay(100+random(300));
    Keyboard.release(key);
}

void loop() {
    delay(6500+random(1000));
    KeyboardPressHuman(KEY_F12);
}