Recommended project setup for library development


I’m working on some libraries in my spare time. Currently they are improved as my projects using them get improved.

Now I’d like to enhance their documentation and (above all) their examples.

What is the recommended setup for an Atom project so that I can work on the library and compile / run the examples included?

Thanks & regards,

There are many ways how to do that. Each developer prefers an own way in this case.

The quick and easy was is to use pio ci command. For example,

pio ci /path/to/myLib/examples/myExample -l /path/to/myLib --board uno

Also, you can try this GUI workflow:

  1. Create new empty PIO project in Atom
  2. Please your future library in project/lib/myLib
  3. Insert in platformio.ini:
src_dir = lib/myLib/examples

platform = ...
board = ...
src_filter = +<myExample1>

platform = ...
board = ...
src_filter = +<myExample2>

In this case, you use different build environments for different examples.

P.S: I didn’t test it.

1 Like