From 35a802009b3f856436f7511e3a9cbf9aa4736e22 Mon Sep 17 00:00:00 2001 From: Ollo Date: Fri, 9 Dec 2022 21:48:43 +0100 Subject: [PATCH] Increase button reaction loop --- main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.lua b/main.lua index a6da2c7..5d3da9c 100644 --- a/main.lua +++ b/main.lua @@ -225,12 +225,12 @@ gpio.mode(3, gpio.INPUT) local btnCounter=0 -- Start the time Thread handling the button local btntimer = tmr.create() -btntimer:register(5000, tmr.ALARM_AUTO, function (t) +btntimer:register(500, tmr.ALARM_AUTO, function (t) if (gpio.read(3) == 0) then mlt:unregister() print("Button pressed " .. tostring(btnCounter)) btnCounter = btnCounter + 5 - for i=1,btnCounter do rgbBuffer:set(i, 128, 0, 0) end + for i=1,btnCounter do rgbBuffer:set(i, 0, 128, 0) end ws2812.write(rgbBuffer) if (btnCounter >= 110) then file.remove("config.lua")