发生致命错误:无法连接到 ESP32:超时等待数据包头

问题描述

我正在尝试使用 esp32 和 Arduino ide 使伺服器旋转,但在上传时出现此错误:“发生致命错误:无法连接到 ESP32:等待数据包报头超时”。我已经尝试将 USB 电缆从我的电脑插入的位置更改为它自己的扩展等......(USB 和弦来自充电器,如果它与 USB 3.0 不同的话)这是我的代码(它只是示例代码。)

#include <ESP32_Servo.h>

Servo myservo;  // create servo object to control a servo
                // 16 servo objects can be created on the ESP32

int pos = 0;    // variable to store the servo position
// Recommended PWM GPIO pins on the ESP32 include 2,4,12-19,21-23,25-27,32-33 
int servoPin = 13;

void setup() {
  myservo.attach(servoPin);   // attaches the servo on pin 18 to the servo object
                              // using default min/max of 1000us and 2000us
                              // different servos may require different min/max settings
                              // for an accurate 0 to 180 sweep
}

void loop() {
  for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}

我的 GND 和 VIN 是从我的伺服和 D13 插入的。所有的帮助将不胜感激。 (顺便说一句,我非常 Arduino 和 ESP32)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)