Get temperature value From Particle


#1

Hey guys some help please im trying to get a temperature value to display from a cloud function that is being exposed through the particle cloud. I wrote the function and tested it . its using the DHT 22 from sesnor and it reads just fine. I have a button and i want it so than when i press that button it displays the temperature directly from the sensor. I have tried almost everything i can think of to no avail, any help please.

Below is my code and screenshots of implementation

With this im getting only temp to display in the box, not the temperature value it self


This is the code implementation
//temp reader
int Engine_temp(String state) {
if (state == “temp” || “”) {
float f = dht.getTempFarenheit();
return (f);
}

else {
return (-1);
}
}