I am embarrassed to ask such a simple question, but I am a newbee Particle Photon programmer and I have really tried hard to get past this problem. I am a retired programmer hoping to use the photon for controlling my remote site Ham Radio Station. I need the temperature sensor to control fans in the outdoor control box.
Whatever I do I cannot seem to get this example program to compile. It is an example in Simon Monk’s beginner book. I am using the Web IDE, I suspect that I must
be doing something wrong in adding these library items to my IDE. In the recent past, I have used the Arduino products. Can anyone help with this? Mike@W8DER.Net
// P_10_thermometer_dallas.ion from Make: "Getting Started with the Photon"
// by Simon Monk
// 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>
double tempC = 0.0;
double tempF = 0.0;
int tempSensorPin = D2;
OneWire oneWire(tempSensorPin);
DallasTemperature sensors(&oneWire);
void setup() {
sensors.begin();
Spark.variable("tempc", &tempC, DOUBLE);
Spark.variable("tempf", &tempF, DOUBLE);
}
void loop() {
sensors.requestTemperatures();
tempC = sensors.getTempCByIndex(0);
tempF = tempC * 9.0 / 5.0 + 32.0;
}
AND THIS IS THE COMPILE ERROR I GET: (I tried the obvious putting " " around the OneWire.h)
lib/spark-dallas-temperature/spark-dallas-temperature.h:27:36: ../OneWire/OneWire.h: No such file or directory
(I tried the obvious putting " " around the OneWire.h) and much more!
In Arduino, the difference is between <> and " " is the file location to search.
OneWire.cpp is version 2.0.1
Spark_Dallas_Temperature is version 0.0.5