Monday, January 11, 2021

PlatformIO project that can also be used in Arduino IDE

This is really a note to myself, since when I create Arduino sketches, I prefer to use PlatformIO. But the projects created in PlatformIO, even if using Arduino framework, does not comply with the Arduino's IDE requirement that the INO filename matches that of its containing folder.

To create such a PlatformIO project:
1. Create a new project in PlatformIO, selecting Arduino as the framework
2. Rename main.cpp inside the src folder to whatever you want the sketch to be called, for example, MySketch.ino
3. Rename the project's src folder to MySketch
4. Edit platformio.ini and add in
[platformio]
src_dir = MySketch
5. Put all other required project files (.h files and such) inside the MySketch folder.

Done!

No comments: