

Serial.begin(115200) // configure serial monitor (serial port over USB, 115200 is the speed) Modify the code in main.cpp with this one ( ): #include "Arduino.h" main.cpp contains two empty functions for the initialization ( setup()) and the actual program loop ( loop()). Finish with “Finish”.Īfter that a new project is created with all necessary folders and files. On the left click the “PlatformIO” icon, then select “PLATFORMIO QUICK ACCESS” –> “PIO Home” –> “Open” and “New Project”.Įnter the project name, select the used hardware board (here “Arduino Uno”) and select the parent folder for the new project or leave “Use Default Location”. Start VS Code and open an empty folder (Menu: File –> Open Folder…) Now the first program can be created and executed on the Arduino Uno.Ĭonnect Arduino Uno to the PC using an USB cable. To do this, select the PlatformIO icon on the left, then click on “Platforms”, search for “Atmel” and select “Atmel AVR” … Select the target PlatformĪfter that you have to install the appropriate framework for the used hardware. After that, the PlatformIO icon will be displayed on the left. After completion, VS Code must be restarted. Start VS Code, on the left select “Extensions”, search for “PlatformIO”, select “PlatformIO IDE” and click “Install”.

Installation Installing Visual Studio Codeĭownload from and start installation. In this tutorial an Arduino Uno R3 with the microcontroller ATmega328P is used as target system. The upload and debugging to or with the target platform is done e.g. Visual Studio Code and PlatformIO are not bound to a specific operating system, Windows, Mac OS X, Linux can be used as development platform. PlatformIO can be used together with various development environments, but the integration with Visual Studio Code is probably the best and the most widely used. for countless microcontrollers, microcomputers, platforms and hardware boards. The entire toolchain for development, debugging and testing, libraries, frameworks, management tools, etc. It provides everything necessary for software development for embedded systems (microcontrollers). The extension that will be used here is PlatformIO. VS Code can be extended by thousands of so-called extensions.

Visual Studio Code (VS Code) is a very powerful Integrated Development Environment (IDE) and is free. Instead of the Arduino IDE, Visual Studio Code can also be used as a development environment for Arduion projects.
