欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 能源 > 【ESP32 】VScode -window环境配置(adruino开发)(点亮LED)

【ESP32 】VScode -window环境配置(adruino开发)(点亮LED)

2024/10/24 21:22:48 来源:https://blog.csdn.net/m0_64551204/article/details/141823603  浏览:    关键词:【ESP32 】VScode -window环境配置(adruino开发)(点亮LED)

  1. 创建工程

新建工程

进行vs code的下载,等待一段时间

工程代码

#include <Arduino.h>// put function declarations here:
int myFunction(int, int);void setup() {// put your setup code here, to run once:int result = myFunction(2, 3);pinMode(2,OUTPUT);
}void loop() {// put your main code here, to run repeatedly:digitalWrite(2,HIGH);delay(100);digitalWrite(2,LOW);delay(100);
}// put function definitions here:
int myFunction(int x, int y) {return x + y;
}

编译工程

报错:

Tool Manager: Looking for another mirror... Tool Manager: Error: Please read https://bit.ly/package-manager-ioerror Tool Manager: Warning! Package Mirror: HTTPSConnectionPool(host='dl.registry.ns3.platformio.org', port=443): Max retries exceeded with url: /tools/8b/e9/ba6c8371b03c0069fcb645f5ace6587ae2760099a164a1b62785115a0f91/tool-mklittlefs-windows_amd64-1.203.210628.tar.gz (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000019D4D685290>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。'))

解决:

在命令行中使用安装所需要的安装包

    依次安装三个包:

    pio pkg install -g --tool "platformio/framework-arduinoespressif32@^3.20007.0"

    pio pkg install -g --tool "tool-esptoolpy @ 1.30300.0(3.0.0)"

    pio pkg install -g --tool "toolchain- riscv32-esp @8.4.0+2021r2-patch3"

下载工程

闪烁现象

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com