chuxuanhy
Posts: 1
Joined: Tue Dec 22, 2015 7:25 am

How to detect digital input state change with interrupt

Tue Dec 22, 2015 7:38 am

Hello everyone,
I would like to have interrupt "change" as in Arduino. I looked at document about interrupt , there were "falling", "rising", and "both". I have tried to use "both" option but the callback function did not trigger when the input was pulled up or down.

Please help me!

...
gpio04 = 4
gpio.mode(gpio04, gpio.INPUT)
gpio.mode(gpio04,gpio.INT,'both',gpio04Changed)
function gpio04Changed()
print("gpio04" .. gpio.read(gpio04))
end
...


Return to “WiFiMCU”

Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests