Had two arduino projects and had to load the libraries in each. Is there a SIMPLE way to load a library so both projects would see them, the way arduino IDE does?
Sort of, yes. But it isn’t recommended. Global libraries are a thing of the past as they have caused numerous problems. However…
- Create a folder, I’m assuming Windows, call it
C:\pio_libs, create a library folder for your common library.
- You can create
includein the new folder but not mandatory.
- Copy your library’s source code into the library folder, or into
platformio.iniand remove the library name(s) from
- Edit the projects source code to ensure you have
#include "library_header.h"as appropriate for the library.
lib_extra_dirs and folders beneath will be searched and used as required.
Thank you Norm