fix(examples):Add delay to throw away bad initial sensor reading
[EVA-2020-02-2.git] / examples / all-in-one-enviro-mini-bk.py
index 5a3dc82a83d7d89ad9b34f5951af62911f7b67a8..dd0d58ad8b1e725f11a29a57f69dbb7e7d9a823a 100755 (executable)
@@ -402,8 +402,10 @@ try:
     # schedule.every().minute.at(":45").do(updateBuffer)
     # schedule.every().minute.at(":50").do(updateBuffer)
     # schedule.every().minute.at(":55").do(updateBuffer)
+    pollSensors() # initial run to start up sensors
+    time.sleep(1) # pause to give sensors time to initialize
     updateBuffer() # initial run
-    pollSensors() # initial run
+
     while True:
         proximity = ltr559.get_proximity()