Why Temp Celsius to Fahrenheit?


#1

I want temp Celsius

" float t = dht.readTemperature();
float h = dht.readHumidity();
Cayenne.virtualWrite(VIRTUAL_TEMP,t);
Cayenne.virtualWrite(VIRTUAL_HUM,h); "


#2

What is your code?


#3

@tad.dvor
#define CAYENNE_DEBUG // Uncomment to show debug messages
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <DHT.h>
#include “CayenneDefines.h”
#include “BlynkSimpleEsp8266.h”
#include “CayenneWiFiClient.h”
#define DHTTYPE DHT11
#define DHTPIN D4
#define VIRTUAL_TEMP1 V3
#define VIRTUAL_TEMP V2
#define VIRTUAL_HUM V1
DHT dht(DHTPIN,DHTTYPE);
// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = “xw6m6ltdmz”;
// Your network name and password.
char ssid[] = “home”;
char password[] = “RuTCh2538”;

void setup()
{

dht.begin();
Serial.begin(9600);
Cayenne.begin(token, ssid, password);
}

void loop()
{
delay(1000);
Cayenne.run();
float t = dht.readTemperature();
float h = dht.readHumidity();
float f = dht.readTemperature(true);
Cayenne.virtualWrite(VIRTUAL_TEMP,t);
Cayenne.virtualWrite(VIRTUAL_HUM,h);
Cayenne.virtualWrite(VIRTUAL_TEMP1,f);
Serial.print(t);
Serial.print(" “);
Serial.print(h);
Serial.print(” ");
Serial.println(f);
}


#5

There’s a problem with Cayenne widgets, they all convert C to F ! it’s useless as is