My nodemcu uses Lua firmware. Recently, when using gpio.trig() to obtain pulse signals, I found that the callback function cannot be triggered completely, and some pulses are always missed. Can someone help me?
Test program:
sendPin=1
receivePin=2
gpio.mode(sendPin,gpio.OUTPUT)
gpio.mode(receivePin,gpio.INT,gpio.PULLUP)
gpio.trig(receivePin,"down",function(level,when,eventcount)
print("level:"..level.." when:"..when.." eventcount:"..eventcount)
end)
gpio.serout(sendPin,0,{900,450},20,1)
Program output:
level:0 when:177186 eventcount:5
level:0 when:184051 eventcount:3
level:0 when:188169 eventcount:3
level:0 when:192288 eventcount:4
level:0 when:197779 eventcount:3
level:0 when:201897 eventcount:1
The output should have 20 lines, but there are only 5 lines (maybe more or less)!