From a04feb7e044e74be81ce28806dcc89ad59a4b23c Mon Sep 17 00:00:00 2001 From: autocommitter Date: Tue, 30 Dec 2025 00:00:03 +0100 Subject: State at 2025-12-30 --- pad/nodes/(-1053,7,-3336).lua | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pad/nodes/(-1053,7,-3336).lua (limited to 'pad/nodes/(-1053,7,-3336).lua') diff --git a/pad/nodes/(-1053,7,-3336).lua b/pad/nodes/(-1053,7,-3336).lua new file mode 100644 index 0000000..f9bc218 --- /dev/null +++ b/pad/nodes/(-1053,7,-3336).lua @@ -0,0 +1,56 @@ +function printLcd(t) + local str = "" + for _, i in ipairs(t) do + str = str .. i .. "\n" + end + + digiline_send("lcd", str) +end + +if not time_table then time_table = {} end + +if event.ext_int then + local catch = event.message + + if catch[1] == "arr1" then + time_table[catch[2]] = 25 + elseif catch[1] == "arr2" then + time_table[catch[2]] = 45 + elseif catch[1] == "arr3" then + + elseif catch[1] == "dep1" then + time_table[catch[2]] = 210 + elseif catch[1] == "dep2" then + time_table[catch[2]] = 180 + elseif catch[1] == "dep3" then + elseif catch[1] == "arr" then + time_table[catch[2]] = 0 + end +elseif event.int and event.msg == "d" then + txt = {" === Next trains ==="} + for i, j in pairs(time_table) do + local approx = "" + + if j > 0 then + time_table[i] = time_table[i] - 5 + end + + if j < 15 then + approx = ">>" + elseif j < 60 then + approx = j .. "s" + else + approx = math.floor(j / 60) .. "m" + end + + table.insert(txt, string.format("Lighthouse %s", approx)) + end + + printLcd(txt) +elseif event.punch then + time_table = {} + digiline_send("lcd", "This is a test") +end + +interrupt_safe(5, "d") + -- cgit v1.2.3