Make PlatformIO project compatible with Arduino IDE

Hello gentlemen,
I cannot find rest to a probably simple answer.
I have a platformio project.
And I would like to compile it on Arduino IDE.

Which mods must be done in order to be Arduino IDE compliant?
I was thinking of:

  1. rename main.cpp into .ino
  2. move the lib folder into Arduino libraries

Does it look I am getting closer to the solution? :slight_smile:

1 Like

I am NOT looking on How to convert an Arduino sketch INTO a Platformio project.
I am asking about doing the opposite:
From Platformio into an Arduino sketch.

See an example of a project which works with PlatformIO and Arduino IDE without any changes:

1 Like

Thanks :slight_smile:

The URL u suggested doesn’t work anymore.

Thanks, I updated link above.

A post was split to a new topic: Getting started with PlatformIO

I have the same question as Leopold.
I have a platformio project and i will open the project in arduino ide. Sorry, but the example in the posted link I dont’ understand…:worried:
What should I do?
Thank you!

1 Like

PlatformIO and Arduino IDE aren’t 100% compatible, but as the example project shows, it doesn’t take much to make it work.

Basically, it’s a matter of:

  1. Creating your project (or open an existing one) - when you do this, you’ll realise where the lib, test and other bits come from).
  2. Renaming the src directory to something, and renaming main.cpp to something.ino (where something is some pertinent name for your project. This meets the Arduino IDE requirement that the .ino must has the same name as the folder containing it.
  3. Editing the platformio.ini file, and adding the following to it (substituting something for the name you used previously):
src_dir = something
  1. That’s pretty much it… if it compiles in PlatformIO, it should compile under the Arduino IDE, assuming you have all the necessary libraries that your project needs installed. All the #includes, function prototypes etc, will be understood by the Arduino IDE because that’s what it’s pre-processor does behind the scenes anyway.

thank you pfeerick!
I try it :grinning:

1 Like