This appears to be a recurring problem. I’m adding a DS18B20 to my board to use with my Photon, and included relevant libraries (DS18B20.h v0.1.8 and OneWire.h v2.0.1).
I’m using the Web IDE. My system firmware target is 0.7.0. I included the libraries via the Web IDE (e.g., “Include in Project”). The include statements were added automatically by the IDE.
When I compile, I get: DS18B20.h: No such file or directory
I also get: Onewire.h: No such file or directory
This happens whether I use <> or “”.
Are these libraries out of date? Are there alternative libraries/components that I should use for temperature sensing? Your help would be very much appreciated.
Could you make a screenshot where we can see the code, includes on the left, ad error on the bottom?
Alternatively, a share link from the web ide would allow us to see an exact copy of your project.
But for the DS18B20 library you don't need to import OneWire.h since the library already features a dependency which instructs the build environment to import that automatically for you.
What system version are you targeting?
When I build any of the contained samples they build just fine with v0.5.3+
Also try adding a blank line before the include statement (the Web IDE preprocessor sometimes has glitches).
Thanks @Moors7 and @ScruffR – I mistyped in my post, and actually had OneWire.h correctly in my code with the W capitalized.
I also noticed in DS18B20.h that OneWire.h was included. I went ahead and removed OneWire.h from my includes, but kept the library installed (unless I should remove that too?).
My system firmware target is 0.7.0 (also on the device). Included libraries include: blynk (0.5.4), OneWire (2.0.1), and DS18B20 (0.1.8).
The only includes are <DS18B20.h> and <blynk.h>. I copied the compilation error below:
As we can’t know what your exact code looks like, I’d like to reiterate on the request for a Screenshot, so we know what we’re dealing with.
Also, make sure you’re using a version of system firmware >0.5.3.
There’s something private in my file, so instead of taking it out, I tested adding DS18B20.h to another app file without anything private (a local copy of servo.ino). If the compiler complained there, I planned to share that file.
That file compiled!! Excuse me, WT*?
So I pasted my code into that file, overwriting the entire thing. It compiled!
I went back to my old file, and It still didn’t compile with DS18B20.h. Maybe it’s in a bad file location, or has a path missing? I created it with “Create New App”.
Who knows, but I’m cool with calling this solved because it compiles now, and I’ll create future files this way. But if you want to debug this, let me know.
It could be that you had a version pre 0.5.3 selected when you created that project and imported the library. Once the project was setup for that version there is no changing of the project layout.
Thanks @ScruffR – I agree because I remember updating the version at one point after I created the project, and wasn’t aware that I couldn’t change the layout.