As the title says... Chat on...

User avatar
By etfloyd
#81351 See this: https://github.com/etfloyd/nodemcu-taskqueue
Simple inline delay that won't ever annoy the watchdog:
Code: Select allrequire("TaskQueue")
tq = TaskQueue()
tq:start()

pin = 5
gpio.mode(pin, gpio.OUTPUT)

tq:schedule(nil, function(self)
  gpio.write(pin, gpio.HIGH)
  coroutine.yield(2)
  gpio.write(pin, gpio.LOW) 
end)