I used a Photon with the Sparkfun Battery Shield in a previous project (ca 2017) and it worked great. I’m doing another project now and am running into problems compiling the sketch with the Sparkfun library.
I’m using Web IDE on a Photon with OS 1.1.0. I step through the Include > Library. SparkFunMAX17043 is listed, I add it, It shows in the sketch:
// This #include statement was automatically added by the Particle IDE. #include <SparkFunMAX17043.h>
and everything appears fine until I try to compile, then I get: SparkFunMAX17043.h: No such file or directory.
I went back to sketches from my earlier project that include the SparkFunMax17043 library and they compile fine with no error.
I’m using Blynk for email notifications and it’s library added and runs fine.
I’m puzzled and would really appreciate any guidance.
I verified mine works fine with 1.1.0 and the Sparkfun library. By some chance did you just add the include statement and didn’t go into the library and add it from there to that project?
No. In the Particle IDE I used the Add Library, selected the SparkFunNAX17043 library and confirmed. The lines in the sketch:
// This #include statement was automatically added by the Particle IDE. #include <SparkFunMAX17043.h
were added by that process.
There are some quirks in Web IDE that may cause such cases.
Often it’s enough to just change #include <SparkFunMAX17043.h> to #include "SparkFunMAX17043.h".
In other cases you may need to doublecheck whether you are actually targeting a device OS version matching the library file hierachy once and then can change to your desired version.
You can also try USE THIS EXAMPLE and then swap out the example code for your own code.
ScruffR - Thank you so much for your prompt reply.
Changing the “<” to quotes didn’t seem to do anything.
I’ve deleted the reference to the Sparkfun library in my sketch and stepped through the “Include in project” process a couple more time with the same result.
Full disclousure: I’ve been out of the Particle world since I installed my last project in 2017 so I’m pretty rusty with the details.
Could you give me a pointer to info on how to “doublecheck whether you are actually targeting a device OS version matching the library file hierachy once and then can change to your desired version”?
In Web IDE, the SparkFunMAX17043 library is 1.1.2. This is the Library version number and doesn’t need to match my Photon Device OS Target (which is 1.1.0.) - right? The Sparkfun library is dated June 22, 2015, but (except for the “1.1.2” in the “Include in project” view) I see no versioning in the .cpp or .h files.
The version in the dropdown list (e.g. 1.2.0-beta.1) is the version you are targetting and below that you see what the cloud thinks you have on your device.
With particle identify (in Listening Mode) you can ask the device what is actually on it.
When I tried the USE THIS EXAMPLE botton on the sample below it built just fine for that Photon you see there
Thank you again for your quick response and sorry for my long delay. For whatever reason, on my 7th or 8th try using the add library in web IDE, the SparkFunMax17043 library added correctly and it verified.