From ff60f97f6609605fff7e15de1f4c16e41028189f Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 12 Jan 2024 17:38:59 +0100 Subject: decrease plot range from 400 .. 2500 to 400 .. 2000 --- src/init.lua | 5 ++--- 1 file 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 -- cgit v1.2.3