 WiFiClient wifiClient;
 WiFiUDP udp;
 
-float H  ;
-float T1 ;
-float T2 ;
-int pir  ;
-float O  ;
-
-float dustDensity ;
-float olddustDensity = -1 ;
+float H  = 0 ;
+float T1 = 0 ;
+float T2 = 0 ;
+float OT = 0 ;
+float PW = 0 ;
+float NW = 0 ;
+int PIR = 0 ;
+float dustDensity = 0;
+
+float OLD_H  = 0 ;
+float OLD_T1 = 0 ;
+float OLD_T2 = 0 ;
+float OLD_OT = 0 ;
+float OLD_PW = 0 ;
+float OLD_NW = 0 ;
+int OLD_PIR = 0 ;
+float OLD_dustDensity = 0 ;
 
 int inuse = 0 ;
 

PubSubClient client(wifiClient, server);

void callback(const MQTT::Publish& pub) {
  Serial.print(pub.topic());
  Serial.print(" => ");
  Serial.println(pub.payload_string());
  inuse = 1;
  lcd_display(pub.payload_string());
}

void lcd_display(String payload) {
  StaticJsonBuffer<200> jsonBuffer;

  char json[] =


time_t prevDisplay = 0; // when the digital clock was displayed

void loop() 
{

  if (timeStatus() != timeNotSet) {
    if (now() != prevDisplay) { //update the display only if time has changed
      prevDisplay = now();
      digitalClockDisplay();
      requestSharp();
      checkDisplayValue();
    }
  }

