스크립트는 Windows 운영 체제에서 텍스트 편집기를 열고 지정된 텍스트를 인쇄합니다.
#if ARDUINO > 10605
#include <Keyboard.h>
#endif
void typeKey(uint8_t key)
{
Keyboard.press(key);
delay(50);
Keyboard.release(key);
}
/* Init function */
void setup()
{
// Begining the Keyboard stream
Keyboard.begin();
//Wait 500ms
delay(500);
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('r');
Keyboard.releaseAll();
delay(500);
Keyboard.print("notepad.exe");
typeKey(KEY_RETURN);
delay(1000);
Keyboard.print("This is my test text.");
// Ending stream
Keyboard.end();
}
/* Unused endless loop */
void loop() {}
No Comments Yet