// This #include statement was automatically added by the Particle IDE.
#include <OneWire.h>
// This #include statement was automatically added by the Particle IDE.
#include <spark-dallas-temperature.h>
DallasTemperature dtSensors(new OneWire(D2));
void setup() {
}
void loop() {
}
The compile error is: lib/spark-dallas-temperature/spark-dallas-temperature.h:27:36: …/OneWire/OneWire.h: No such file or directory
Over the last few years, I have built a dozen or more applications using DS18B20 sensors and this code. The existing apps still compile without error. They have also been working without problems for a ;year or more each.
I’ve been away from buildiing apps for a year or so, So clearly something has changed with the build environment. I’m using the web IDE.
Can anyone offer a clue as to how I get this working again?
I can copy the code for the library into my application, make one change to the .h include statement, and it works. But seems like not the right thing to do for every app. It would be nice to have local libraries, but as I understand, they only work in the desktop IDE, and that will not run correctly on my windows 10 computer.
I’m obviously confused by the whole libraries 2.0 “feature”
In that case, the best option is probably to make a fork of spark-dallas-temperature and fix the include definition. It probably would also be a good idea to make it have a library dependency on OneWire so you only need to include spark-dallas-temperature in your project.
i find myself in the same boat as brianD as i attempted to re-create an old proton app with new sensors. looking in the library i find many spark-dallas-temp ~~ versions as well as a variety of ds18 / onewire / wire libraries. wondering if there is any pertinent updates to this thread.
is there any way to tell which libraries are valid for current use? my app will use ds18b20s
BTW, I did create a new app, then copy/paste most of the old app. But I get hung up in brianD’s original ‘include fail’.
EDIT: I am rewriting my code to use the DS19B20 library. Thanks RICKKAS7.
FIXED, kinda.
I did convert to the ds18b20 library and removed references to spark-dallas-temperature in my code. I did continue to get the brianD errors UNTIL…
I forgot to remove the old library (both OneWire.h and spark-dallas-temperature.h) from the list of “Included Libraries” found in the Particle Apps column below the app name. i.e. it was my own error!