My board works fine in non-cloud mode. As soon as I go to the cloud, I get constant zeros for temp on the dashboard. I read in this forum that it could be a mixup in global vs. local variables, but my code declares a global (at least I think so). Any advice would be much appreciated.
Variable for temperature is temp used for both the code below and my Cloud Variable.
Code is below:
//Libraries
#include "DHT.h";
//Constants
#define DHTPIN 2 // what pin we're connected to
#define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino
//Variables
int chk;
float hum; //Stores humidity value
float temp; //Stores temperature value
void setup()
{
Serial.begin( 9600);
dht.begin();
}
void loop()
{
//Read data and store it to variables hum and temp
hum= dht.readHumidity();
temp= dht.readTemperature(true);
// Print temp and humidity values to serial monitor
Serial.print(temp);
Serial.println(" Fahrenheit");
Serial.print(hum);
Serial.println(" Humidity");
delay(3000); //Delay 3 sec.
}