Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
关于arduino中的命令窗口_Arduino - Fatal编程技术网

关于arduino中的命令窗口

关于arduino中的命令窗口,arduino,Arduino,我一直在使用Arduino UNO微控制器进行我的项目。我想知道如何打开一个窗口来键入,例如,char C来完成我分配给它的任务。例如,下面的代码 #include <Servo.h> Servo servothumb; int command; int x =1; // Define thumb servo void setup() { Serial.begin (115200); servothumb.attach(2); // Set thumb servo to dig

我一直在使用Arduino UNO微控制器进行我的项目。我想知道如何打开一个窗口来键入,例如,char C来完成我分配给它的任务。例如,下面的代码

#include <Servo.h>
Servo servothumb; 

int command; int x =1;

// Define thumb servo
void setup() {
Serial.begin (115200);
servothumb.attach(2); // Set thumb servo to digital pin 2
}

void loop() {
if(Serial.available() > 0){ 
     command = Serial.read(); 
       if (command == 'c'){}
}
close();
delay(4000); }

void close() { 
  servothumb.write(0);

}

您需要在com端口上打开一个串行终端程序。因此,在windows中,您可以使用Putty.exe,并将其配置为在com1或Arduino连接到的任何com端口上运行。

我认为您最好在这里: