CLion is a cross-platform C/C++ IDE for Linux, OS X, and Windows. CLion includes such features as a smart editor, code generation, code quality assurance, automated refactorings, on-the-fly code analysis, project manager, integrated version control systems and debugger.

Refer to the CLion Documentation page for more detailed information.

Quick Start¶ This tutorial introduces you to the basics of PlatformIO for CLion workflow and shows you a creation process of a simple “Blink” example. After finishing you will have a general understanding of how to work with projects in the CLion IDE. Setting Up the Project¶ Please open “New Project” wizard, select board and framework, and create a new PlatformIO project. Please USE ONLY Latin characters (a-z) in a project name to avoid further issues with project compilation. Numbers and some symbols are allowed depending on a file system: Rename main.c file in src folder to main.cpp (right click on a file main.c , Refactor > Rename…) . Paste the next contents: Warning The code below works only in pair with Arduino-based boards. Please follow to PlatformIO Project Examples repository for other pre-configured projects. /** * Blink * * Turns on an LED on for one second, * then off for one second, repeatedly. */ #include "Arduino.h" // Set LED_BUILTIN if it is not defined by Arduino framework // #define LED_BUILTIN 13 void setup () { // initialize LED digital pin as an output. pinMode ( LED_BUILTIN , OUTPUT ); } void loop () { // turn the LED on (HIGH is the voltage level) digitalWrite ( LED_BUILTIN , HIGH ); // wait for a second delay ( 1000 ); // turn the LED off by making the voltage LOW digitalWrite ( LED_BUILTIN , LOW ); // wait for a second delay ( 1000 ); } Build & Upload¶ Open project configuration wizard and add PlatformIO Upload and PlatformIO Debug configurations (you can add the rest configurations if you need them): Remove pre-task (“Build”) from PlatformIO Upload and PlatformIO Debug configurations to avoid double project building. You should see “There are no tasks to run before launch”. Select PlatformIO Upload configuration and use the “Build” button for project compilation or the “Run” for a firmware uploading: Configuration options¶ Build options

Upload options

Device/Serial Monitor¶ Please open CLion terminal and use Device Manager CLI. You can also configure device monitor per project using Monitor options. Please note that you need to manually close/stop device monitor before firmware uploading.