This post is the first of a 4-part series on how to use Microsoft Visual Studio Code (VS Code) and PlatformIO for Arduino ESP8266 development. This part deals with the installation of VS Code and PlatformIO.
VS Code Installation
1. Download VS Code at https://code.visualstudio.com/.
2. Double click on the downloaded file to start the installation process.
On my computer, VS Code is installed at C:\Users\WeiHsiungHuang\AppData\Local\Programs\Microsoft VS Code.
PlatformIO Installation
Click on Extensions. Then enter "platformio" in the search field. Click "Install" to install PlatformIO.
Note, the picture below was taken AFTER PlatformIO had been installed.
A screen similar to the below will appear after the installation is completed.
Create A New PlatformIO Project For ESP8266
1. Click on "+ New Project" under "Quick Access".
2. Enter project name, select board type and framework.
As for the location, for my computer, the default location is at "C:\Users\WeiHsiungHuang\Documents\PlatformIO\Projects".
3. Click "Finish" for PlatformIO to start downloading the required files and setup up the environment.
Note, when PlatformIO encounters problem downloading files, disable anti-virus then try again.
On my computer, the newly created project is placed under "C:\Users\WeiHsiungHuang\Documents\PlatformIO\Projects".
Take a look inside the newly created "ESP8266 Arduino Projects".
In VS Code, the newly created project can be found in the EXPLORER window.
Click on "platformio.ini" to check the configuration settings.
Click on "src" then on "main.cpp" to find the place that holds the main code. Unlike Arduino IDE which uses "*.ino" file as the starting point, in PlatformIO, "main.cpp" is used as the starting point instead.
Click here to go to part 2 of this series.
Reference:
#1 PlatformIO Installation with VSCode - An IDE for IoT Apps
https://www.youtube.com/watch?v=CB8qC_-RHQI
No comments:
Post a Comment