一、准备工作
数据线X 1 、 四博智联 ESPC2-12 开发板 X 1


二、环境搭建
1、进入https://code.visualstudio.com 官网下载VSCODE软件

2、安装完成后安装乐鑫插件如下图

3、插件安装完后,查看- 命令面板(快捷键Ctrl+Shift+P)。
4、输入configure esp-idf extension,点击。

5、选择第二项

6、按下图选项选择,路径可以自定义,等待安装完成

三、编译demo
1、查看- 命令面板(快捷键Ctrl+Shift+P)
2、输入show examples projects,点击。
3、点击弹出的Use current ESP-ID,使用本地SDK,也就是前面自定义IDF的路径

4、如下图创建工程

5、选择芯片类型,我们需要选择esp32-c2



6、使用usb数据线连接PC与开发板,选择串口


7、开始编译工程build,编译过程可能需要几分钟

8、编译完成如下图


9、使用烧录工具烧录程序到开发板。打开flash_download_tool_3.9.3.exe,选择ESP32-C2型号


10、选择烧录文件,按下图所示进行烧录,等待烧录完成

四、效果演示
1、打开串口工具ThingsTurn_Serial_Tool.exe,默认波特率74880

编程指南:
https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32c2/get-started/index.html
|