Gpio.Trig - double pulse.
Posted: Wed Dec 02, 2015 3:57 am
Hello Dear Friends. I Use Hall Sensor ( AH49E from Waveshare) connected D0 to GPIO2 on Esp8266-01.
Below code is doubling counts i don' know why, i just want one pulse on trig when its up... but it counts second up when pulse is longer than 1 or 2 seconds.... very strange.
I use nodemcu_float_0.9.6-dev_20150704.
and
Below code is doubling counts i don' know why, i just want one pulse on trig when its up... but it counts second up when pulse is longer than 1 or 2 seconds.... very strange.
I use nodemcu_float_0.9.6-dev_20150704.
Code: Select all
function gasInterrupt()
print("Gaspuls Detected")
PulseGas = PulseGas + GasCounterValue
tmr.delay(10000)
print(PulseGas)
end
end
and
Code: Select all
gpio.mode(pin, gpio.INT)
gpio.trig(pin, "up", gasInterrupt)