When I switch from double variable type to INT my data stops being accepted by ubidots. When I switch back to double everything works again. The only difference is the variable type declaration. Am I missing something?
// This #include statement was automatically added by the Particle IDE.
#include "Ubidots/Ubidots.h"
// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_DHT/Adafruit_DHT.h"
//token for ubidots
#define TOKEN "abc123abc123abc123abc123"
#define DHT1PIN 2 // fridge temp
#define DHT2PIN 4 // internal temp
#define DHTTYPE DHT22 // DHT 22 (AM2302)
Ubidots ubidots(TOKEN);
DHT dhtFridge(DHT1PIN, DHTTYPE);
DHT dhtInternal(DHT2PIN, DHTTYPE);
// Define variables
double fridgeTemp = 0;
double internalTemp = 0;
double fridgeHumid = 0;
double internalHumid = 0;
void setup()
{
Particle.variable("fridgeT", fridgeTemp); //make fridge temps avail via var
Particle.variable("internalT", internalTemp); //make internal temps avail via var
dhtFridge.begin();
dhtInternal.begin();
Serial.begin(9600);
delay(10000);
}
void loop()
{
//Read humidity into humidity vars
fridgeHumid = dhtFridge.getHumidity();
internalHumid= dhtInternal.getHumidity();
//Read Farenheit into Temp vars
fridgeTemp = dhtFridge.getTempFarenheit();
internalTemp = dhtInternal.getTempFarenheit();
ubidots.add("fridgeTemp", fridgeTemp); //define fridgeTemp as ubidot var
ubidots.add("internalTemp", internalTemp); //define interalTemp as ubidot var
ubidots.sendAll(); //send vars to ubidot
delay(60000); //delay sixty sec
// Publish temp var for reading remotely
Particle.publish("fridgeTemp", String(fridgeTemp) + " °F");
Particle.publish("internalTemp", String(internalTemp) + " °F");
}