pin=5
gpio.mode(pin,gpio.INT,gpio.PULLUP)
function buttonpress(level)
print("Down")
end
gpio.trig(pin, 'low', buttonpress)Above works fine. Now, I'd like to add some code to determine how long the button is held down (like all those buttons to advance time on a clock) but I can't get anything to work.
I thought I'd change from interrupt to gpio.INPUT and read using tmr.alarm but it works once and quits.
Any suggestions?