【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"

下载工程

闪烁现象

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在使用VSCode配置ESP-IDF环境时,有几个步骤需要遵循。 首先,需要下载并安装VSCode软件。然后,在VSCode中下载并安装Espressif IDF插件。这一步只需下载插件,不需要进行任何配置。接下来,需要下载ESP-IDF工具。可以在终端中运行以下命令来下载ESP-IDF工具: ``` mkdir -p ~/esp cd ~/esp git clone --recursive https://github.com/espressif/esp-idf.git ``` 在下载完成后,需要进行工具的配置。在终端中运行以下命令: ``` cd ~/esp/esp-idf ./install.sh ``` 然后,需要设置环境变量。同样在终端中运行以下命令: ``` cd ~/esp/esp-idf ./export.sh ``` 为了方便使用,可以在`~/.bashrc`文件中添加一个宏命令。打开`~/.bashrc`文件,可以使用以下命令: ``` vi ~/.bashrc ``` 在文件的最后一行添加以下命令: ``` alias get_idf='. $HOME/esp/esp-idf/export.sh' ``` 保存文件后,每次打开一个新的终端窗口,只需要输入`get_idf`命令,就可以给对应的终端窗口添加ESP-IDF的环境变量。 最后,可以创建自己的工程并开始开发。希望这些步骤能够帮助您成功配置ESP-IDF环境并在VSCode中进行开发。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [ESP-IDF/VSCode安装和使用(ESP32开发环境)](https://blog.csdn.net/luhanhua/article/details/131028184)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [ESP-IDF + Vscode ESP32 开发环境搭建以及开发入门](https://blog.csdn.net/qq_43332314/article/details/129015602)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值