1.安装vsvode

2.安装PlatformIO IDE插件

3.创建项目![Description]

Description a.Board选项为芯片型号 b.去掉Location勾选选择自定义路径

常用platformio.ini配置

  • esp32
[env:featheresp32]
platform = espressif32
board = featheresp32
framework = arduino
board_build.partitions = huge_app.csv;使用蓝牙可能内存不足添加此项

build_flags = 
    -D USE_BLUETOOTH=1
    ; -D USE_WiFi=1


  • esp32c3
[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
board_build.partitions = huge_app.csv;使用蓝牙可能内存不足添加此项
board_build.flash_mode = dio
build_flags = 
    -D ARDUINO_USB_MODE=1                       ;开启USB Slave 功能
    -D ARDUINO_USB_CDC_ON_BOOT=1                ;开启CDC 下载功能宏
    -D USE_BLUETOOTH=1
lib_deps = 
    dlloydev/ESP32 ESP32S2 AnalogWrite@^5.0.2
  • esp8266/esp01/esp01s
[env:nodemcu]
platform = espressif8266
board = nodemcu
framework = arduino