长生栈 长生栈
首页
  • 编程语言

    • C语言
    • C++
    • Java
    • Python
  • 数据结构和算法

    • 全排列算法实现
    • 动态规划算法
  • CMake
  • gitlab 安装和配置
  • docker快速搭建wordpress
  • electron+react开发和部署
  • Electron-创建你的应用程序
  • ImgUI编译环境
  • 搭建图集网站
  • 使用PlantUml画时序图
  • 友情链接
关于
收藏
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

Living Team

编程技术分享
首页
  • 编程语言

    • C语言
    • C++
    • Java
    • Python
  • 数据结构和算法

    • 全排列算法实现
    • 动态规划算法
  • CMake
  • gitlab 安装和配置
  • docker快速搭建wordpress
  • electron+react开发和部署
  • Electron-创建你的应用程序
  • ImgUI编译环境
  • 搭建图集网站
  • 使用PlantUml画时序图
  • 友情链接
关于
收藏
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 计算机视觉

  • ESP32开发

    • ESP32-开发环境配置
      • Arduino IDE
        • 快速开始
    • ESP32-点亮LED灯
    • ESP32-点亮OLED屏幕
    • ESP32-实时操作系统freertos
    • ESP32-PWM驱动SG90舵机
    • ESP32-网络摄像头方案
  • Linux系统移植

  • 快速开始

  • 编程小知识

  • 技术
  • ESP32开发
DC Wang
2025-06-14
目录

ESP32-开发环境配置

# ESP32-开发环境配置

本文以ESP32-S3N16R8为例,介绍如何使用Arduino IDE 和 PlatformIO IDE编译ESP32。

# Arduino IDE

官网: Software | Arduino (opens new window)

img

  • Verify / Upload - 编译代码并将其上传到您的 Arduino 板。
  • Select Board & Port - 检测到的 Arduino 板及其端口号会自动显示在此处。
  • Sketchbook - 在此处您将找到本地存储在本计算机上的所有项目文件。此外,您还可以与 Arduino Cloud 同步,以及从在线环境获取您的项目文件。
  • Boards Manager - 浏览可安装的 Arduino 和第三方软件包。例如,使用 MKR WiFi 1010 板需要安装 Arduino SAMD Boards 软件包。
  • Library Manager - 浏览由 Arduino 及其社区开发的数千个 Arduino 库。
  • Debugger - 实时测试和调试程序。
  • Search - 在代码中搜索关键词。
  • Open Serial Monitor - 以新标签页的形式在控制台中打开串口监视器工具。

# PlatformIO IDE for VSCode

官网:Your Gateway to Embedded Software Development Excellence · PlatformIO (opens new window)

在vscode中使用platformio:插件市场里搜索PlatformIO IDE。

# 快速开始

官方文档:PlatformIO IDE for VSCode — PlatformIO latest documentation (opens new window)

本教程向您介绍 PlatformIO IDE 工作流的基础知识,并向您展示一个简单的 “Blink” 示例的创建过程。完成后,您将对如何在 IDE 中处理项目有一个大致的了解。

  1. 在PlatformIO底部工具栏中点击 “PlatformIO Home” 按钮,如图:

    ../../_images/platformio-ide-vscode-welcome.png

  2. 点击“New Project”,选择一个板子并创建项目

​ image-20250608090553655

  1. 在src目录下打开 main.cpp 并替换成下面内容:

    /**
     * Blink
     *
     * Turns on an LED on for one second,
     * then off for one second, repeatedly.
     */
    #include "Arduino.h"
    
    // Set LED_BUILTIN if it is not defined by Arduino framework
    #define LED_BUILTIN 13
    
    void setup()
    {
      // initialize LED digital pin as an output.
      pinMode(LED_BUILTIN, OUTPUT);
    }
    
    void loop()
    {
      // turn the LED on (HIGH is the voltage level)
      digitalWrite(LED_BUILTIN, HIGH);
    
      // wait for a second
      delay(1000);
    
      // turn the LED off by making the voltage LOW
      digitalWrite(LED_BUILTIN, LOW);
    
       // wait for a second
      delay(1000);
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
  2. 编译项目可以使用快捷键 ctrl+alt+b 或者使用PlatformIO底部工具栏的按钮

    ../../_images/platformio-ide-vscode-build-project.png

PaltformIO还支持断点调试功能,与vscode正常调试方法一样。

编辑 (opens new window)
#ESP32
Janus-Pro部署和使用
ESP32-点亮LED灯

← Janus-Pro部署和使用 ESP32-点亮LED灯→

最近更新
01
ESP32-网络摄像头方案
06-14
02
ESP32-PWM驱动SG90舵机
06-14
03
ESP32-实时操作系统freertos
06-14
更多文章>
Theme by Vdoing | Copyright © 2019-2025 DC Wang All right reserved | 辽公网安备 21021102001125号 | 吉ICP备20001966号-2
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式