PlatformIO Community

Working on arduino libraries



I am new to platformio, I need to use it for an arduino library I am working on. I was wondering which is the best way to work on an arduino project/library because the platformio structure differ a lot to the arduino library
example of an arduino lib:
│ ├───advanced_working
│ └───basic_working
│ └───…

Where the source code are in ‘src’ and in examples there are some .ino sketches

What do you suggest me to have a clean as possible folder structure as the arduinio one? i need it because I am pubblishing it to github and to the arduino library manager


After a lot of googling i found how to procede, i will write a short guide in the case someone will have the same problem:

  1. go to the root folder (where there is the file) of the library which you want to develop and run pio init
  2. Open Project with your favourite ide
  3. in platformio.ini write:
    src_dir = examples/your_sketch_name
    lib_dir = src ;yes it appear to be wrong but is right
  4. enjoy platformio!

I also opened a issue on the docs repo hoping @ivankravets or @valeros would see it