I'm using TFT_eSPI library from Bodmer. To setup my display I need to modify two files "user_setup.h" and one other. They are located in the library path.
In my sketch I include:
#include TFT_eSPI.h
Which in turn includes the "user_setup.h" and another similar file.
I would rather not modify the files in the library but copy them to the sketch folder, then modify them.
However the compiler goes to the library for these files. If I change their name the compiler reports no "user_setup.h" found.
Can I force the compiler to first look in the sketch folder then the library folder? I realize I could (may be able to) change the #include from <> to "" but I'd rather not change that library file.
In general case no.
At the start of building process the IDE copies all files from your sketch directory to a newly created temp folder for compile.
The library code compiled separately inside it own directory and knows nothing about your sketch and its location during compilation.
Yes. Unfortunately your code snippet does not show how you include (maybe because you did not use code tags).
#include "TFT_eSPI.h" will look for that file in the sketch directory; if it does not exist, it will look in the libraries directory.
Be aware that one or more of the library files might still contain #include <TFT_eSPI.h> and hence will not use your TFT_eSPI.h.
I thank that your best bet is to place the complete TFT_eSPI library in the src directory under your sketch directory and hack that library. Temporarily remove the original TFT_eSPI so there is no chance that you by accident include something from that.
sketchbook
+-- your sketch
+-- src
+-- TFT_eSPI
You will need to use #include "src/TFT_eSPI/TFT_eSPI.h" in your sketch.
HI, I'm not sure what a "private library folder" compared to the Arduino IDE library folder "C:\Users\john\Documents\Arduino\libraries"
I could only fine one reference to "private library folder" and that was for IDE V1.x
Is this different from the default library folder?
Isn't that the purpose of the private library folder?
I you are referring to the default library folder then in my case NO. I have multiple different displays and to work on each I have to manually change these configuration files.
I like to have just one copy of a library. If I want to use multiple versions then I'll create a gift repo in that folder and checkout a new branch to put my changes on. If I want to go back to the old version then I'll check that out. If I want a third version then I'll make another new branch based on whatever and make changes and check that out.