Trybotics Logo

Setup JetBrains Clion for Arduino Development

DESCRIPTION

Hi my name is adam, I love to work with Arduino for my hobby projects, but I find that Arduino IDE not very attractive and helpful tool. This days programmers have a lot of IDEs which do auto-complete, auto-formating code, show you mistakes and best practice before you push compile and run button. I work with Jet Brains IDES in my opinion they are the best and they can give you license free for open source projects. But if you wanna use it for programming arduino you have to done a little setup. In next steps I will show you all need to know for successfully install IDE and upload code to Arduino.

Advantages of Clion Arduino IDE:

  1. Auto-complete code
  2. Code formatter
  3. Intelligent refactoring tools
  4. Controlling code for mistakes and best practice without compiling and uploading
  5. Version control (Git, SVN, etc.)

Ps: I will use linux ubuntu mate, but it will works on windows Os to.

Description:

Download Clion from

this website https://www.jetbrains.com/clion/download/#section=linux-version

Description:

Open Clion and go to Configure/Settings/Pluggins. Choose 'Browse Repositories' and click install, then restart Clion.

For https://plugins.jetbrains.com/plugin/8031?pr= use same approach as for Arduino plugin.

Description:

After you installed

the plugin, you will see in Welcom window New Arduino Project click and start new arduino project.

PS: I like Dracula color theme in Clion, you can switch to it in File/Settings/Appearance & Behavior/Appearance switch Theme to Dracula.

In project you have
to most important files One “.ino” where is your code for Arduino, and the second which is named CMakeLists.txt where we need to do a little configuration. At line 6 you setup

what type of Arduino you are using (for my setup is “uno”). And at line 7 you setup port where is

Arduino connected to computer. Thats it for setup :)

Description:

And for the last step you have to upload sketch to Arduino.

#include
void setup() {
pinMode(13,OUTPUT); Serial.begin(9600); }
void loop() {
Serial.println("Hi");
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW); delay(1000);
}

This is the code just make LED blink and write to serial monitor Hi. On the top right corner of IDE you have to push Play button and choose executable file where is your sketch. Than upload code to Arduino. Click on Serial Monitor on the bottom of window setup port and push button upper option button in Serial Monitor window. I you done everything correctly you will see “Hi” message every 2 seconds and blink LED on arduino.

This
is the code just make LED blink and write to serial monitor Hi. On the top right corner of IDE you have to push Play button and choose executable file where is your sketch. Than upload code to Arduino. Click on Serial Monitor on the bottom of window setup port and push button upper option button in Serial Monitor window. I you done everything correctly you will see “Hi” message every 2 seconds and blink LED on arduino.

Sorry for my English :)

Description:


YOU MIGHT ALSO LIKE