 
 #ifdef ESP8266
     expand.begin();
+
+    String r = ESP.getResetReason();
+
+    if (r == "Deep-Sleep Wake") {
+        clear = false;
+    }
 #else
     mySerial.begin(9600);
 #endif


    display.begin();
    dht22.begin();

#ifdef ESP8266
    WiFi.mode(WIFI_STA);
    WiFi.disconnect();
    delay(100);
    WiFi.forceSleepBegin(); // Use WiFi.forceSleepWake() to enable wifi

    String r = ESP.getResetReason();

    if (r == "Deep-Sleep Wake") {
        clear = false;
    }
#endif

    if (clear) {
        display.clear();

    }

    expand.attachInterrupt(iter);

    WiFi.disconnect();
    delay(100);
    WiFi.forceSleepBegin(); // Use WiFi.forceSleepWake() to enable wifi
#endif


    sensor.set_sleep(false);
    sensor.set_mode(sds011::QUERY);
