From 243a8063ddbb107ab191aa333cc6cdc85701f410 Mon Sep 17 00:00:00 2001 From: cheapie Date: Sun, 2 Jan 2022 18:42:08 -0600 Subject: Add Luacontroller examples/help system --- mesecons_luacontroller/examples/counter.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 mesecons_luacontroller/examples/counter.lua (limited to 'mesecons_luacontroller/examples/counter.lua') diff --git a/mesecons_luacontroller/examples/counter.lua b/mesecons_luacontroller/examples/counter.lua new file mode 100644 index 0000000..bbb974c --- /dev/null +++ b/mesecons_luacontroller/examples/counter.lua @@ -0,0 +1,11 @@ +--LCD Counter (requires digilines) +--Counts the number of pulses sent to pin A and displays the number on an LCD. +--Connect the LCD over digilines and set the channel to "lcd" + +if event.type == "program" then + mem.count = 0 +elseif event.type == "on" and event.pin.name == "A" then + mem.count = mem.count + 1 +end + +digiline_send("lcd",tostring(mem.count)) -- cgit v1.2.3