我正在尝试使用键盘功能通过键盘打印字符串,在这种情况下,我正在尝试打印以下语句。
CODE
____
Keyboard.begin()
Keyboard.print("echo \"-----BEGIN CERTIFICATE-----\" >> text.txt"); //--> Arduino
delay(200)
Keyboard.print(KEY_RETURN);
Keyboard.end();
output
______
echo @-----END CERTIFICATE-----@ >> text.txt
Desired output
______________
echo "-----BEGIN CERTIFICATE-----" >> text.txt
谁能帮我这个!!!下面是示例代码
#include <Keyboard.h>
void setup()
{
Keyboard.begin();
delay(5000);
// Minimize all windows
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('d');
Keyboard.releaseAll();
delay(50);
// run task
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('r');
Keyboard.releaseAll();
delay(100);
Keyboard.print("PowerShell -NoLogo");
delay(100);
Keyboard.write(KEY_RETURN);
delay(100);
//-------------------- the above code works fine ---------------------
// save file
Keyboard.print("echo \"-----BEGIN CERTIFICATE-----\" >> text.txt");//---> this line
delay(50);
Keyboard.write(KEY_RETURN);
delay(500);
Keyboard.end();
}