Hi, I'm working on doing server temperature detector project. I'm using ESPresseo Lite v2.0, USB to UART Converter and DHT22 Temperature and Humidity Sensor. My temperature can detect the temperature and humidity perfectly and display the result in every 1 second. I want know how to set temperature range like perhaps within 30 Celsius till 35 Celsius in order to give out push notification?
if ((temp >= 30) && ( temp <= 35)) push();
Hi. Can you please help me with my coding. If I want to set my temperature range how shall I write it? I attach a copy below.
if (millis() - loopTime >= 5000) {
loopTime = millis();
float t = espert.dht.getTemperature();
float h = espert.dht.getHumidity();
if (!isnan(t) && !isnan(h)) {
String outString = "{\"temperature\":\"" + String(t) + "\", ";
outString += "\"humidity\":\"" + String(h) + "\", ";
outString += "\"name\":\"" + String(espert.info.getId()) + "\"}";
espert.println(outString);
espert.mqtt.publish(outTopic, outString);
// espert.oled.clear();
// espert.oled.println(String("....") + millis());
}
}
delay(100);
Thanks
Hi,
Can you please post a copy of your complete sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html
Thanks... Tom...
.