Left here for archival purposes.

User avatar
By Kenny Horner
#38110 I need some help with a project. I need the esp to read a gpio state and count how long it was reading high until the gpio goes low. I am trying to do this using the lua programming language.

thank you
User avatar
By gsker
#38272
Kenny Horner wrote:I need some help with a project. I need the esp to read a gpio state and count how long it was reading high until the gpio goes low. I am trying to do this using the lua programming language.

thank you


Kenny,
Post some code and a specific question and you'll likely get some help. Your question is very open-ended.

Look up gpio.trig and tmr.now (and the limitations of the timers).
http://stackoverflow.com/questions/3242 ... -incorrect and
http://www.thalin.se/2015/04/nodemcu-tm ... -bugs.html