我如何从Arduino向CMD写信?
我需要从Arduino发送一些语法打印到cmd上 符号应为以下行:我如何从Arduino向CMD写信?,cmd,arduino,Cmd,Arduino,我需要从Arduino发送一些语法打印到cmd上 符号应为以下行: "bartend.exe /F=C:\Users\feniger\Desktop\BarTenderFiles\PSLableV03.btw /P" 谢谢,Yaron这要求您通过Arduino模拟键盘。为此,最简单的方法是使用Arduino Leonardo或Arduino Leonardo Pro Micro。使用此功能,您可以在任何位置输入任何字符串,例如终端、文本编辑器等 如果找不到这些板,请使用Atmega32u4控制
"bartend.exe /F=C:\Users\feniger\Desktop\BarTenderFiles\PSLableV03.btw /P"
谢谢,Yaron这要求您通过Arduino模拟键盘。为此,最简单的方法是使用Arduino Leonardo或Arduino Leonardo Pro Micro。使用此功能,您可以在任何位置输入任何字符串,例如终端、文本编辑器等 如果找不到这些板,请使用Atmega32u4控制器搜索Arduino。Atmega32u4控制器具有USB功能,可以解决您的问题 对于windows cmd,您可以使用以下代码打开命令提示符并自动键入所需的命令
#include "Keyboard.h"
void setup() {
// initialize control over the keyboard:
Keyboard.begin();
// first open run by windows + r
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('r');
Keyboard.releaseAll();
// adjust delay according to your requierment
delay(4000);
// press enter to open cmd
Keyboard.press(KEY_RETURN);
Keyboard.releaseAll();
// adjust delay according to your requierment
delay(4000);
// commond to be entered
char* cmd = "bartend.exe /F=C:\Users\feniger\Desktop\BarTenderFiles\PSLableV03.btw /P";
// print command to cmd
Keyboard.print(cmd);
delay(50);
// press enter to run cmd
Keyboard.press(KEY_RETURN);
Keyboard.releaseAll();
}
void loop() {
}
模拟一个键盘。你在这里问什么真的不清楚。您正在尝试从Arduino远程控制Windows PC吗?它们是如何连接的?您正在尝试启动命令行shell还是它已经在运行?您好。Arduino通过串行连接到PC。我想启动一个命令行。一旦Arduino中的某个触发器被激活,我需要将以下语法写入CMD:bartend.exe/F=C:\Users\feniger\Desktop\BarTenderFiles\PSLableV03.btw/Phi谢谢!我和阿杜伊诺·莱昂纳多一起工作。好吧,我该怎么写CMD?我已经编辑了答案。请检查一下。我希望现在一切都清楚了。