From 10fa0b67a6bff5de3a4095ac6c8808864f3ba3c4 Mon Sep 17 00:00:00 2001 From: ollo Date: Sun, 19 Jun 2016 23:09:43 +0200 Subject: [PATCH] Dreiviertel can be activated or deactivated --- displayword.lua | 9 +++++++-- webpage.lua | 3 ++- webserver.lua | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/displayword.lua b/displayword.lua index aece11c..b36396c 100644 --- a/displayword.lua +++ b/displayword.lua @@ -33,7 +33,12 @@ function generateLEDs(words, color) -- line3---------------------------------------------- --TODO ggf. auch ueber viertel vor abbildbar if (words.threequater == 1) then - buf= buf .. color:rep(11) -- Dreiviertel + if (threequater ~= nil) then + buf= buf .. color:rep(11) -- Dreiviertel + else + buf= buf .. white:rep(4) + buf= buf .. color:rep(7) -- VIERTEL + end elseif (words.quater == 1) then buf= buf .. white:rep(4) buf= buf .. color:rep(7) -- VIERTEL @@ -41,7 +46,7 @@ function generateLEDs(words, color) buf= buf .. white:rep(11) end --line 4-------- even row (so inverted) ------------- - if (words.before == 1) then + if ((words.before == 1) or (words.threequater == 1 and threequater == nil)) then buf=buf .. white:rep(2) buf= buf .. color:rep(3) -- VOR else diff --git a/webpage.lua b/webpage.lua index 84f54f9..aee9501 100644 --- a/webpage.lua +++ b/webpage.lua @@ -28,10 +28,11 @@ function sendWebPage(conn,answertype) buf = buf .."WIFI-SSID" buf = buf .."WIFI-Password" buf = buf .."SNTP Serverntp server to sync the time" - buf = buf .."Offset to UTC timeDefine the offset to UTC time in hours. E.g +1" + buf = buf .."Offset to UTC timeDefine the offset to UTC time in hours. E.g +1" buf = buf .."Red" buf = buf .."Green" buf = buf .."BlueAll Colors: 0 - 255" + buf = buf .."Three quaterDreiviertel Joa/nei" buf = buf .. "
" buf = buf .. "
" buf = buf .."" diff --git a/webserver.lua b/webserver.lua index a49a678..e046596 100644 --- a/webserver.lua +++ b/webserver.lua @@ -75,6 +75,11 @@ function startWebServer() color=string.char(_POST.red, _POST.green, _POST.blue) end file.write("color=string.char(" .. string.byte(color,1) .. "," .. string.byte(color, 2) .. "," .. string.byte(color, 3) .. ")\n print(\"Config from " .. sec .. "\")\n") + if (_POST.threequater ~= nil) then + file.write("threequater=true\n") + else + file.write("threequater=nil\n") -- unset threequater + end file.close() sec=nil file.remove(configFile)