Strange, I just removed Spark-Dallas-Temperature by tricking Chrome into finally letting me click the remove button (left click, hold, right click hold, release buttons, wait for pop-up seemed to work).
That didn’t fix it, but what did fix it was:
Create a new project file
Add in the libraries
Copy and past all code (exact same code)
Compile
Working
Unsure what is going on, I’m suspecting the upgrade from the ‘old project file format’ to the new one when libraries changed didn’t kick in correctly?
I am still having issues with OneWire reference in dallas-temp due to that folder in a folder reference, about to try fix that by manually copying the library in and adjusting that line (hopefully works…)
Thank you @kennethlimcp for helping to show it was working in another file - that gave me the idea to create a brand new project and try it again, which worked! While I avoided the problem and didn’t really ‘solve’ it - it at least helped me continue on.
I also got the dallas temp library working which was good
Step 1. Remove OneWire & Dallas Temp libraries from left hand menu
Step 2. Add in files for the libraries manually at the top of the code screen (.cpp and .h files for both libraries) - see screenshot
Step 3. Copy and paste the library code into the files
Step 4. Edit the dallas temp file - circled in red in the attached screenshot.
The library pointing/referencing wasn’t playing nice, even removing the …/OneWire/OneWire.h and making it OneWire.h or …/OneWire.h didn’t work for me… meh
I’m having a similar issue adding the Adafruit_DHT. I add the lib through the IDE but when I compile I get the .h file missing error. I have tried adding in the files manually as suggested by @Cameron but that results in an ‘error saving firmware’.
Am I missing something?
here’s the code:
// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_DHT.h"
// DHT parameters
#define DHTPIN 5
#define DHTTYPE DHT11
// Variables
int temperature;
int humidity;
int light;
// Pins
int light_sensor_pin = A0;
// DHT sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// Start DHT sensor
dht.begin();
}
void loop() {
// Humidity measurement
temperature = dht.getTempCelcius();
// Humidity measurement
humidity = dht.getHumidity();
// Light level measurement
float light_measurement = analogRead(light_sensor_pin);
light = (int)(light_measurement/4096*100);
// Publish data
Spark.publish("temperature", String(temperature) + " °C");
delay(2000);
Spark.publish("humidity", String(humidity) + "%");
delay(2000);
Spark.publish("light", String(light) + "%");
delay(2000);
}
which works but becomes an issue when there are multiple nested libraries…in the end though the issue was that I was running old firmware, after updating to the newest version it works fine.
Just to confirm - this is still an issue with the Cloud IDE. The fix is as above - just make a new file, include the libraries and paste the code that didn’t work in the other file. This is definitely a Cloud IDE bug.