ESP32-S开发 之 PlatformIO

本文的主线 简介 => 安装 => 项目 => 调试

简介

PlatformIO Professional collaborative platform for embedded development

  • 支持的开发板
1
2
3
4
5
pip install -U platformio

pio --version

pio boards

安装

1
2
3
4
5
C/C++
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools

PlatformIO IDE
https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide

项目

  • 打开PIO Home => New Project

esp32-s-platformio-01.png

1
vim src/main.cpp
1
2
3
4
5
6
7
8
9
10
#include <Arduino.h>

void setup() {
// put your setup code here, to run once:
}

void loop() {
printf("hello\n");
delay(1000);
}
  • PlatformIO: Upload

调试

  • 打开”串口调试助手”

  • 发送串口数据 接收到响应 效果如下

esp32-s-platformio-02.png