PlatformIO the new Arduino IDE ?!

PlatformIO the new Arduino IDE ?!

For a few months I started learning the Arduino in order to create projects that do not require a large installation. The Raspberry Pi was fine at first, but soon you realize that it’s too big for projects that only require a temperature control or different display script.

The official Arduino IDE is very comprehensive, but soon after several hours of writing, my eyes started to make me a headache. All this white ! ARGH !

So I  quickly looked for an alternative. And found it under the name of PlatformIO. To explain quickly, PlatformIO is a mod for Atom.io that allows you to compile for Arduino boards.

capture-decran-2016-11-09-a-10-26-57

Installation :

First download and install the application from the site. When it’s done, start Atom to see the splash screen

capture-decran-2016-11-09-a-10-41-02

Click on New Project

capture-decran-2016-11-10-a-08-48-41

Start by choosing a board (I have only an Arduino Mega but you can select more than one board), your project’s directory. Hit Enter !

capture-decran-2016-11-10-a-08-48-34

You should now see some folders/files.

capture-decran-2016-11-10-a-08-55-18

Create a new file called blink.cpp and add this code :

#include <Arduino.h>

void setup() {
 pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
 digitalWrite(LED_BUILTIN, HIGH);
 delay(1000);
 digitalWrite(LED_BUILTIN, LOW);
 delay(1000);
}

Don’t forget to add :

#include <Arduino.h>

Save it, then Build and Upload it to your Arduino Board.

capture-decran-2016-11-10-a-08-59-49

If all went well, you should see a few seconds later, the Builtin LED flash on your Board.

Install Libraries :

capture-decran-2016-11-10-a-09-08-00It’s not  hard to install libraries on Atom, just a little bit different. You can use their website and follow the instructions or  Just open in your project the platformio.ini and add a new key called lib_deps =. Then the git folder to the lib. For example :

lib_deps =
    https://github.com/PaulStoffregen/Time.git
    https://github.com/JChristensen/DS3232RTC.git
    https://github.com/FastLED/FastLED.git
    https://github.com/nethoncho/Arduino-DHT22.git

PlatformIO PlatformIO offers many options such as a terminal or a Serial Monitor but it would take too long to explain ton of options that this mod has to offer.

I use it for several days now, and I must admit that I can no longer do without it. Lightweight, easy to use and nicer to code with for hours without headache it’s a real pleasure.

I won’t compare the compile or upload time, but i’m pretty sure that this is more or less equivalent to the official IDE.

(source : platformio.org)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s