-->
Page 2 of 3

Re: simple delay, wait or pause function

PostPosted: Fri May 15, 2015 9:01 am
by joefly888
John, This worked easily. Thanks

Re: simple delay, wait or pause function

PostPosted: Fri May 15, 2015 10:04 am
by j0hncc
That's good!
Maybe you figured this out, but my code was wrong, it should actually be
Code: Select alltmr.alarm(  0, 2000, 0, turnOffLed )

Third parameter is 0==once, 1==repeating

Re: simple delay, wait or pause function

PostPosted: Fri May 15, 2015 10:54 am
by joefly888
Thanks for the heads up, I did not notice, as the LED was always otherwise off, so I did not notice it repeatedly turning it off. But I did correct my code thanks.

That leads me to ask, what is the 1st parameter of "0" do?

Thanks again

Re: simple delay, wait or pause function

PostPosted: Fri May 15, 2015 11:16 am
by j0hncc
Oh that is the timer number 0-6, you can decide which of these do what.

You do know about this reference page, right?
https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en#new_gpio_map
See Timer Module.
But generally avoid using tmr.delay !

Cheers,
John