 //  Measurement read command is delayed,
 //  By repeatedly checking the "measuring" bit of status register (0xF3) until ready
 
-//  Last updated on 12/02/2019
-
 //  Features :  //////////////////////////////////////////////////////////////////////////////////////////////////////
 /*                                                                                                                      
 1. Connect to Wi-Fi, and upload the data to either Blynk App  or Thingspeak
 2. Monitoring Weather parameters like Temperature, Pressure, Humidity and Altitude.
 3. Extra Ports to add more Weather Sensors like UV Index, Light and Rain Guage etc.
 4. Remote Battery Status Monitoring
-5. V2.0 Using Sleep mode to reduce the energy consumed
-6. v2.2 Modify to add GY-1145 UV sensor & DHT22 & do it as option in code (CSC)
+5. Using Sleep mode to reduce the energy consumed
+6. v2.1 Modify to add GY-1145 UV sensor & DHT22 & do it as option in code (CSC)
 7. v2.2 Add tzapu/WifiManger, allow user to enter Blynk authentication code or Thinkspeak API,
         only allow to enter either one, if both detected, only use the Blynk
-
+8. v2.3 Add Double Reset Detector - to detect double press on reset button and wipe the wifi settings
 */
 
 // Todo

  //  eventCounter ++;
  //  saveCounter(eventCounter);         // this also puts bme0 to sleep
  bme0.updateF4Control16xSleep(); // use instead of saveCounter if counter is not required
  goToSleep();
} // end of void setup()


  //Local intialization. Once its business is done, there is no need to keep it around
  WiFiManager wifiManager;

  if (drd.detectDoubleReset()) {
    Serial.println("Double Reset Detected");
    //shall do clean up of API key after wifi reset
      wifiManager.resetSettings();
      ESP.reset();
      delay(1000);
  } else {
    Serial.println("No Double Reset Detected");
  }

  //set config save notify callback
  wifiManager.setSaveConfigCallback(saveConfigCallback);

