Post your best Lua script examples here

User avatar
By Lawrence_jeff
#10238 Also consider changing your button interrupt code to only trigger on up or down, not both... the way you have it now when you press a button and release you are telling it to run your function on both the transition to high and the transition back to low so even a perfect switch would still try to run it twice.

If you do this you might not need to debounce (At least I don't bother in my code and it works fine) I think the time it takes LUA to process the initial interrupt gives the button time to return to its initial state.