2
votes

I'd like to have a Arduino library that includes a file "Config.h", where every sketch that includes that library would have its own "Config.h".

According to the Arduino documentation (https://www.arduino.cc/en/Hacking/BuildProcess), the sketch's directory should always be in the include path:

The include path includes the sketch's directory, the target directory (/hardware/core//) and the avr include directory (/hardware/tools/avr/avr/include/), as well as any library directories (in /hardware/libraries/) which contain a header file which is included by the main sketch file.

When I include "Config.h" in the library, however, it can not find the file in the sketch's directory. Is this broken, or am I misunderstanding the Arduino documentation?

1

1 Answers

0
votes

You might want to try putting the entire library in the sketch folder. You can hit ctrl+k on windows(maybe cmd+k for mac? I'm not sure) to open it. Don't put another folder into the sketch folder, put everything on the top level. I tried this method put for myself and it worked.

Hope this helped!

-Dave