开发环境配置
下载软件包
链接: https://pan.baidu.com/s/1W6vpoNU_8L1SgmzlXPQDTA?pwd=6666 提取码: 6666
安装python
1. 先检查系统中是否有python可用
2. 安装python
双击打开压缩包中的python-3.13.3-amd64.exe文件,按下图所示勾选相关选项,点击Install Now快速安装

3. 更改下载源
打开cmd执行如下指令,更新python下载源为国内阿里云源,以提后后续相关软件包下载速度
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/执行完毕之后,可以通过如下指令检查执行结果
pip config list如果显示如下内容,表示更改下载源成功

安装Platformio Core
打开cmd命令行终端,运行如下指令安装platformio core
python C:\Users\Admin\Desktop\开发环境相关软件包\get-platformio.py其中的C:\Users\Admin\Desktop\开发环境相关软件包\get-platformio.py为压缩包中的文件,请使用绝对路径,如下图所示

安装完成提示如下

其中绿色文字提示了platformio安装目录
安装完成后,将压缩包中的开发板离线数据包.zip这个压缩文件进行解压,得到如下两个文件夹

将这两个文件夹内容全选复制,然后全部拷贝到上面platformio core的安装目录

安装vscode
双击运行压缩包中的VSCodeUserSetup-x64-1.100.0.exe,按照软件正常安装流程安装即可
安装中文插件
安装完vscode以后,在插件市场搜索Chinese安装中文汉化插件,点击安装即可
安装platformio插件
按照同样的方法,搜索platformio插件,并安装,稍等几秒钟,即可安装成功

插件安装完成之后,打开左边的蚂蚁头图标

安装Prettier - Code formatter插件 (建议安装)
插件市场搜索Prettier - Code formatter,按照之前的方法安装,该插件能够快速将代码格式化,代码编写过程中,按下键盘ctrl+s即可自动格式化代码,保持整洁的代码格式。

安装Error Lens插件 (可选)
插件市场搜索Error Lens,按照之前的方法安装,该插件能够将错误信息报告得更详细,比如你在写代码时,将英文分号写成了中文分号,该插件会明确提示你。


最后,将自己一直使用的VSCode配置项分享给大家,大家可全部复制粘贴使用,也可以根据自己习惯选择性参考
{
"files.autoSave": "afterDelay",
"files.autoGuessEncoding": true,
"workbench.list.smoothScrolling": true,
"editor.cursorSmoothCaretAnimation": "on",
"editor.smoothScrolling": true,
"editor.cursorBlinking": "smooth",
"editor.mouseWheelZoom": true,
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.formatOnSave": true,
"editor.wordWrap": "on",
"editor.guides.bracketPairs": true,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.acceptSuggestionOnEnter": "smart",
"editor.suggestSelection": "recentlyUsed",
"window.dialogStyle": "custom",
"debug.showBreakpointsInOverviewRuler": true,
"workbench.startupEditor": "none",
"editor.fontSize": 25,
"editor.fontFamily": "Consolas, 'Courier New', monospace",
"prettier.tabWidth": 4
}替换方式为,点击Vscode左下角小齿轮,然后点击设置

然后点击右上角的小图标

最后将settings.json这个文件中的内容全部清空,替换成上述博主提供的配置

至此,vscode+platformio的开发环境安装完毕.