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

User avatar
By mcfly777
#38529 Hi
This is my first post here and I'm a beginner in this area. I have a general question about LUA in the NodeMCU environment.

I am trying to have my code executed linearly, and for example if I ask to connect to an AP, I'd like to wait for that connection to occur before going on to the next step. I have found a solution that involves putting code in a tmr.alarm function, but that does not seem very elegant.

I have the impression that the entire code is run as the file is loaded, i.e. very fast and the processor doesn't wait for the commands to execute. Can someone please clarify how it works for me?

thanks
Leo
User avatar
By TerryE
#39186
mcfly777 wrote:Hi
I am trying to have my code executed linearly, and for example if I ask to connect to an AP, I'd like to wait for that connection to occur before going on to the next step.


Read my FAQ as per link below. You can't. This is a limitation of the task-driven SDK.