fix(examples):Add delay to throw away bad initial sensor reading
authorSteven Baltakatei Sandoval <baltakatei@gmail.com>
Mon, 19 Apr 2021 00:12:42 +0000 (00:12 +0000)
committerSteven Baltakatei Sandoval <baltakatei@gmail.com>
Mon, 19 Apr 2021 00:12:42 +0000 (00:12 +0000)
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()