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_Embedded_Hardware_Sensors_Arduino Uno - Fatal编程技术网

Arduino ';上载草图时出错';阿杜伊诺

Arduino ';上载草图时出错';阿杜伊诺,arduino,embedded,hardware,sensors,arduino-uno,Arduino,Embedded,Hardware,Sensors,Arduino Uno,我正在学习从Arduino的UART引脚接收数据。我使用的是同一个规格的气体传感器。这是我能写的最简单的代码 void setup() { Serial.begin(9600); } void loop() { if(Serial.available()>0) { Serial.print(Serial.available()); } } 代码进行了验证,但当我尝试在Arduino Uno中刻录此代码时,在它指出代码使用了5%的存储空间后,我得到了以下错误 Sket

我正在学习从Arduino的UART引脚接收数据。我使用的是同一个规格的气体传感器。这是我能写的最简单的代码

void setup() {
  Serial.begin(9600);
}

void loop() {
  if(Serial.available()>0) {
    Serial.print(Serial.available());
  }
}
代码进行了验证,但当我尝试在Arduino Uno中刻录此代码时,在它指出代码使用了5%的存储空间后,我得到了以下错误

Sketch uses 1744 bytes (5%) of program storage space. Maximum is 32256 bytes.
Global variables use 184 bytes (8%) of dynamic memory, leaving 1864 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1e
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x66
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x7e
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x06
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x86
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xf8
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x06
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x7e
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x86
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x9e
An error occurred while uploading the sketch
我在网上查了一个解决方案,但他们提供了基本的答案,比如重启一切。它不起作用


请提供帮助。

上载草图时,在上载成功之前,必须断开串行I/O引脚与任何设备的连接

Uno与用于执行草图上传的USB共享两个硬件串行插脚,因此其他任何东西都不能连接到串行插脚(0和1)


如果我没记错的话,你只需要断开Rx引脚,但那是从内存中断开的,所以断开这两个引脚,它几乎肯定会工作。

上传草图时,在上传成功之前,你必须断开串行I/O引脚与任何设备的连接

Uno与用于执行草图上传的USB共享两个硬件串行插脚,因此其他任何东西都不能连接到串行插脚(0和1)


如果我没记错的话,你只需要断开Rx引脚,但那是从内存中断开的,所以断开这两个引脚,它几乎肯定会工作。

上传草图时,检查arduino板是否设置为正确配置。例如选择uno板、串行端口、,即使在构建双向模型时,分配SAM板时也能工作。

上传草图时,检查arduino板是否设置为正确配置。例如,选择uno板、串行端口,即使在构建双向模型时,分配SAM板时也能工作