我有一个arduino micro,它正在使用keyboard.h库ref
但是当它键入时,它会键入一些随机的东西 例如
ref:https://www.arduino.cc/reference/en/language/functions/usb/keyboard/ LED已焊接到引脚3并接地,但不起作用
#include <HID.h>
#include <Keyboard.h>
//#define WindowsKey VK_RWIN;
//#define Enter VK_RETURN;
void setup() {
pinMode(3, OUTPUT);
digitalWrite(3, HIGH);
Keyboard.begin();
delay(500);
Keyboard.press("");
Keyboard.write("shutdown -s -t 300 -c \"SAMPLE TEXT\" -sg -fw -d u 4:1"); // problem i think
delay(500);
Keyboard.press("VK_RETURN");
delay(500);
Keyboard.releaseAll();
delay(500);
Keyboard.releaseAll();
delay(500);
Keyboard.write("powershell");
delay(500);
Keyboard.press("VK_RETURN");
delay(500);
Keyboard.releaseAll();
delay(3000);
Keyboard.press("VK_RETURN");
delay(500);
Keyboard.write("shutdown -s -t 300 -c \"SAMPLE TEXT\"");
delay(500);
Keyboard.press("VK_RETURN");
Keyboard.releaseAll();
digitalWrite(3, LOW);
}
void loop() {
//eat shit
}
当我将其插入时,它会塞满键盘,因此即使拔下电源键也始终处于大写锁定状态