Title says most of it. In the Arduino IDE, how do I attach one header file to multiple sketches?
I clicked on Sketch->Add file, but it made a copy of the file. Now I have to edit multiple files to make any one change.
Title says most of it. In the Arduino IDE, how do I attach one header file to multiple sketches?
I clicked on Sketch->Add file, but it made a copy of the file. Now I have to edit multiple files to make any one change.
#include "headerfile.h"
I tried that prior to the Sketch->Add file.
Where should the file be located? I have it in the Arduino sketch folder (my documents->Arduino) but the IDE says it cannot find the file.
C:\Users\anthony\Documents\Arduino\Pool_Heater_Panel_V2\Pool_Heater_Panel_V2.ino:12:25: fatal error: Pool_Modbus.h: No such file or directory
#include "Pool_Modbus.h"
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
The best place to put it would be in the libraries subfolder of your sketchbook:
{C:\Users\anthony\Documents\Arduino}
|_libraries
|_Pool_Modbus
|_Pool_Modbus.h
That assumes C:\Users\anthony\Documents\Arduino is your sketchbook folder.
If you want to put it somewhere else then you need to provide the absolute path to the file in the #include directive.
Thank you.