allow temperature reads to converge a bit faster
authorCiprian Manea <ciprian.manea@gmail.com>
Sat, 3 Aug 2019 22:49:01 +0000 (01:49 +0300)
committerCiprian Manea <ciprian.manea@gmail.com>
Sat, 3 Aug 2019 22:49:01 +0000 (01:49 +0300)
examples/all-in-one-no-pm.py
examples/all-in-one.py
examples/compensated-temperature.py

index ab1a1a76923e15a9940ec2b5aee13ddf6e9064dc..f7ebcdcb42bbfeac369ab1a612fbf55ac0bbb0fd 100755 (executable)
@@ -87,7 +87,7 @@ def get_cpu_temperature():
 # temperature down, and increase to adjust up
 factor = 0.8
 
-cpu_temps = [0] * 5
+cpu_temps = [get_cpu_temperature()] * 5
 
 delay = 0.5  # Debounce the proximity tap
 mode = 0  # The starting mode
index 6314137e4dfb4109740ec33f1ba70e1e2bb891d6..ca0760b6e84f651a456921b88f5ed34f37a1c424 100755 (executable)
@@ -93,7 +93,7 @@ def get_cpu_temperature():
 # temperature down, and increase to adjust up
 factor = 0.8
 
-cpu_temps = [0] * 5
+cpu_temps = [get_cpu_temperature()] * 5
 
 delay = 0.5  # Debounce the proximity tap
 mode = 0  # The starting mode
index 367961003a6cd90afdcd0251f3e6d04e4ff90887..2733f56c756d43a2bcc1cf57a6eef085ed9f6117 100755 (executable)
@@ -33,7 +33,7 @@ def get_cpu_temperature():
 # temperature down, and increase to adjust up
 factor = 0.8
 
-cpu_temps = [0] * 5
+cpu_temps = [get_cpu_temperature()] * 5
 
 while True:
     cpu_temp = get_cpu_temperature()