summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-01-12 17:38:59 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-01-12 17:38:59 +0100
commitff60f97f6609605fff7e15de1f4c16e41028189f (patch)
treed8d7a60dad6804077fca76156826f599c978289c
parent57652547f1842fc02bfed31a17f7fbd2252c9ea5 (diff)
decrease plot range from 400 .. 2500 to 400 .. 2000
-rw-r--r--src/init.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/init.lua b/src/init.lua
index 8e81ca1..07ccc2d 100644
--- a/src/init.lua
+++ b/src/init.lua
@@ -103,7 +103,7 @@ function measure()
fb.y = 0
fb.print(fn, string.format("%4d.%d c %3d.%d %%", raw_temp/65536 - 45, (raw_temp%65536)/6554, raw_humi/65536, (raw_humi%65536)/6554))
- past[past_pos] = (co2 - 400) / 64
+ past[past_pos] = (co2 - 400) / 50
past[past_pos] = past[past_pos] >= 0 and past[past_pos] or 0
past[past_pos] = past[past_pos] <= 31 and past[past_pos] or 31
past_pos = (past_pos) % 128 + 1
@@ -114,12 +114,11 @@ function measure()
ssd1306.show(fb.buf)
fb.init(128, 64)
+ collectgarbage()
publish_count = publish_count + 1
if have_wifi and influx_url and publish_count >= 4 and not publishing_http then
publish_count = 0
publish_influx(co2, raw_temp, raw_humi, bat_mv)
- else
- collectgarbage()
end
end