diff --git a/displayword.lua b/displayword.lua index 3039f8f..7e47e1a 100644 --- a/displayword.lua +++ b/displayword.lua @@ -1,5 +1,5 @@ -- Module displaying of the words -function generateLEDs(words, color) +function generateLEDs(words, color, colorMin1, colorMin2, colorMin3, colorMin4, characters) local space=string.char(0,0,0) -- update the background color, if set diff --git a/main.lua b/main.lua index fc0ba62..41d7147 100644 --- a/main.lua +++ b/main.lua @@ -51,17 +51,9 @@ function displayTime() print("Local time : " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second) words = display_timestat(time.hour, time.minute) - if ((words.min1 == 1) and (color1 ~= nil)) then - color=color1 - elseif ((words.min2 == 1) and (color2 ~= nil)) then - color=color2 - elseif ((words.min3 == 1) and (color3 ~= nil)) then - color=color1 - elseif ((words.min4 == 1) and (color4 ~= nil)) then - color=color4 - end - ledBuf = generateLEDs(words, color) + ledBuf = generateLEDs(words, color, color1, color2, color3, color4, + display_countwords_de(words)) -- Write the buffer to the LEDs ws2812.write(ledBuf)