summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-01-12 17:33:15 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-01-12 17:33:15 +0100
commitdd1504ff132ccfca475f66884a8d8f4caacc0b1e (patch)
treea3be5e214dd854dddf596a12670c385519600827
parent697fa046d7e8d656afc9f7531c80491fcbebd009 (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 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