Skip to main content
updated links
Source Link
Juraj
  • 18.3k
  • 4
  • 32
  • 50

To utilize subfolders with any name in an Arduino library, you must use the 1.5 library specificationthe 1.5 library specification.

In libraries folder in your sketch folder, create a folder for the library. In this folder create a src subfolder and put the library source code into that subfolder. Then create a library.properties filelibrary.properties file in the root folder of the library with some dummy information. Fill the includes key with the main .h file of the library.

Documents/
  Arduino/
   libraries/
     FooLib/
      src/
       subfoldername/
        header.h
        some.h
        some.cpp 
       foolib.h 
       foolib.cpp
      library.properties

In code then use in #include the path with src folder as starting location.

#include <subfoldername/header.h>

To utilize subfolders with any name in an Arduino library, you must use the 1.5 library specification.

In libraries folder in your sketch folder, create a folder for the library. In this folder create a src subfolder and put the library source code into that subfolder. Then create a library.properties file in the root folder of the library with some dummy information. Fill the includes key with the main .h file of the library.

Documents/
  Arduino/
   libraries/
     FooLib/
      src/
       subfoldername/
        header.h
        some.h
        some.cpp 
       foolib.h 
       foolib.cpp
      library.properties

In code then use in #include the path with src folder as starting location.

#include <subfoldername/header.h>

To utilize subfolders with any name in an Arduino library, you must use the 1.5 library specification.

In libraries folder in your sketch folder, create a folder for the library. In this folder create a src subfolder and put the library source code into that subfolder. Then create a library.properties file in the root folder of the library with some dummy information. Fill the includes key with the main .h file of the library.

Documents/
  Arduino/
   libraries/
     FooLib/
      src/
       subfoldername/
        header.h
        some.h
        some.cpp 
       foolib.h 
       foolib.cpp
      library.properties

In code then use in #include the path with src folder as starting location.

#include <subfoldername/header.h>

Source Link
Juraj
  • 18.3k
  • 4
  • 32
  • 50

To utilize subfolders with any name in an Arduino library, you must use the 1.5 library specification.

In libraries folder in your sketch folder, create a folder for the library. In this folder create a src subfolder and put the library source code into that subfolder. Then create a library.properties file in the root folder of the library with some dummy information. Fill the includes key with the main .h file of the library.

Documents/
  Arduino/
   libraries/
     FooLib/
      src/
       subfoldername/
        header.h
        some.h
        some.cpp 
       foolib.h 
       foolib.cpp
      library.properties

In code then use in #include the path with src folder as starting location.

#include <subfoldername/header.h>