无法重置Arduino Leonardo代码

时间:2019-12-16 08:55:38

标签: arduino arduino-ide

我试图学习使用Arduino Leonardo Pro Mini进行键盘仿真的方法。

我写的代码是

#include <Keyboard.h>

void setup() {
Keyboard.begin()
}

void loop() {
Keyboard.println("Hello World");
}

这很好,现在我想用空代码重置微控制器

void setup()
{
}

void loop()
{
}

但是以前的代码不允许我这样做。 即使端口选择正确(以下情况我也可以肯定),这是错误消息

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

1 个答案:

答案 0 :(得分:1)

此错误与您上传的代码无关。

原因:

  • 缺少引导程序
  • 引导程序损坏
  • 错误的引导程序设置
  • 连接错误
  • 连接到硬件Rx / Tx的东西...