From b9e3812a72d2c5b30f218ba4a57890be4ad7e43c Mon Sep 17 00:00:00 2001 From: ollo Date: Wed, 8 May 2019 21:12:02 +0200 Subject: [PATCH] module display word loadable in the simulation --- displayword.lua | 2 +- main.lua | 12 +++++++----- simulation/src/de/c3ma/ollo/WS2812Simulation.java | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/displayword.lua b/displayword.lua index da094f2..c1358e7 100644 --- a/displayword.lua +++ b/displayword.lua @@ -254,4 +254,4 @@ M = { data = data, } end -return M \ No newline at end of file +displayword = M diff --git a/main.lua b/main.lua index 3e75444..fa89b32 100644 --- a/main.lua +++ b/main.lua @@ -1,5 +1,7 @@ -- Main Module +displayword = {} + function startSetupMode() tmr.stop(0) tmr.stop(1) @@ -54,12 +56,12 @@ function displayTime() else words.briPercent=nil end - dp = dofile("displayword.lc") - if (dp ~= nil) then - ledBuf = dp.generateLEDs(words, color, color1, color2, color3, color4) - print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second .. " char: " .. tostring(dp.data.drawnCharacters)) + dofile("displayword.lc") + if (displayword ~= nil) then + ledBuf = displayword.generateLEDs(words, color, color1, color2, color3, color4) + print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second .. " char: " .. tostring(displayword.data.drawnCharacters)) end - dp = nil + displayword = nil if (ledBuf ~= nil) then --if lines 4 to 6 are inverted due to hardware-fuckup, unfuck it here if ((inv46 ~= nil) and (inv46 == "on")) then diff --git a/simulation/src/de/c3ma/ollo/WS2812Simulation.java b/simulation/src/de/c3ma/ollo/WS2812Simulation.java index 388d3f0..1c4cff9 100644 --- a/simulation/src/de/c3ma/ollo/WS2812Simulation.java +++ b/simulation/src/de/c3ma/ollo/WS2812Simulation.java @@ -160,9 +160,8 @@ public class WS2812Simulation implements LuaSimulation { callScript(this.scriptName); } } catch (InterruptedException e) { - + } - } private void callScript(String filename) {