Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dividuum committed Apr 18, 2015
1 parent 7b706c1 commit 9246b0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions flap-display/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ Even using just the (bash) shell:
all in one line:
(echo -en "display\n"; while true; do echo "##go_up##"; head -n 10 /proc/meminfo; sleep 1; done) > /dev/tcp/localhost/4444

You must send your data encoded as latin1. The following letters are valid:
' abcdefghijklmnopqrstuvwxyzäöü0123456789@#-.,:?!()'

letters.png created by https://github.com/MichaelKreil
4 changes: 2 additions & 2 deletions flap-display/node.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end

local Display = function(display_cols, display_rows)
local t = resource.load_image "letters.png"
local mapping = ' ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ0123456789@#-.,:?!()'
local mapping = ' abcdefghijklmnopqrstuvwxyzäöü0123456789@#-.,:?!()'

local function make_mapping(cols, rows, tw, th)
local chars = {}
Expand Down Expand Up @@ -41,7 +41,7 @@ local Display = function(display_cols, display_rows)
assert(#value <= rowsize)
value = value .. string.rep(" ", rowsize-#value)
for i = 1, rowsize do
local char = string.sub(value,i,i):upper()
local char = string.sub(value,i,i):lower()
local pos = string.find(mapping, char, 1, true)
if not pos then
pos = 1 -- character not found
Expand Down

0 comments on commit 9246b0a

Please sign in to comment.