diff --git a/Readme.md b/Readme.md index 751ac1d..36f3cf0 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,7 @@ # ESP Wordclock ## Setup +### Initial Setup Install the firmware on the ESP: The ESP must be set into the bootloader mode, like [this](https://www.ccc-mannheim.de/wiki/ESP8266#Boot_Modi) @@ -22,5 +23,12 @@ Then disconnect the serial terminal and copy the required files to the microcont ./tools/initialFlash.sh /dev/ttyUSB0 +### Upgrade + +Determine the IP address of your clock and execute the following script: +
+./tools/remoteFlash.sh IP-Address ++ ## Internal Setup * GPIO2 LEDs diff --git a/displayword.lua b/displayword.lua index c7fe7fe..113d205 100644 --- a/displayword.lua +++ b/displayword.lua @@ -85,15 +85,24 @@ function generateLEDs(words, colorForground, colorMin1, colorMin2, colorMin3, co minutes = minutes + 4 end data.charsPerMinute = round( (characters / minutes) ) - - -- devide by five (Minute 0, Minute 1 to Minute 4 takes the last chars) - print("Minutes : " .. tostring(minutes) .. " Char minutes: " .. tostring(data.charsPerMinute) ) + if (adc ~= nil) then + briPercent=(100*adc.read(0)/900) + print("Minutes : " .. tostring(minutes) .. " Char minutes: " .. tostring(data.charsPerMinute) .. " bright: " .. tostring(briPercent) .. "%") + data.colorFg = colorForground + data.colorMin1 = colorMin1 + data.colorMin2 = colorMin2 + data.colorMin3 = colorMin3 + data.colorMin4 = colorMin4 + else + -- devide by five (Minute 0, Minute 1 to Minute 4 takes the last chars) + print("Minutes : " .. tostring(minutes) .. " Char minutes: " .. tostring(data.charsPerMinute) ) + data.colorFg=colorForground + data.colorMin1=colorMin1 + data.colorMin2=colorMin2 + data.colorMin3=colorMin3 + data.colorMin4=colorMin4 + end data.words=words - data.colorFg=colorForground - data.colorMin1=colorMin1 - data.colorMin2=colorMin2 - data.colorMin3=colorMin3 - data.colorMin4=colorMin4 data.drawnCharacters=0 data.drawnWords=0 data.amountWords=display_countwords_de(words) diff --git a/index.html b/index.html index a6caac6..a938ea3 100644 --- a/index.html +++ b/index.html @@ -19,4 +19,4 @@