From dd1504ff132ccfca475f66884a8d8f4caacc0b1e Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 12 Jan 2024 17:33:15 +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 b88ee16..00ce3b0 100644 --- a/src/init.lua +++ b/src/init.lua @@ -62,7 +62,7 @@ function uart_callback(data) local line1 = string.format("%4d ppm\n", mh_z19.co2) local line2 = string.format("%4d c\n", mh_z19.temp) - past[past_pos] = (mh_z19.co2 - 400) / 64 + past[past_pos] = (mh_z19.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) % 48 + 1 @@ -87,6 +87,7 @@ function uart_callback(data) end ssd1306.show(fb.buf) fb.init(128, 32) + collectgarbage() publish_count = publish_count + 1 if have_wifi and publish_count >= 4 and not publishing_mqtt then publish_count = 0 @@ -108,8 +109,6 @@ function uart_callback(data) collectgarbage() end end) - else - collectgarbage() end end -- cgit v1.2.3