Search code examples
arduinoincludearduino-ide

Managing an Arduino project involving multiple boards


How would I go about easily managing an Arduino project that has multiple sketches(project/sketch_)/sketch_0.ino; project/sketch_1/sketch_1.ino; ecc.) for multiple boards with a unique configuration .h file?

I've already tried

#include "../config.h"

...

or

#include <../config.h>

...

but it doesn't seem to work. Any help?


Solution

  • Put that file in the libraries folder in a folder called "config" and then you can use it in each of your programs like a regular library. You might consider giving it a slightly more unique name though in case you want to do a similar thing with other projects. Just make sure the folder it's in has the same name as the .h file and it's in the user libraries folder for the IDE.