Message during setup() doesn't work in version 2.0.x
-
Hello all,
I tried to convert the sketch from my relay node to the new version 2.0.x. In the setup() routine I set the state of the relay to off and sent the state to the controller. In version 1.5.4 worked this without problems. Now with version 2.0.0, it doesn't work anymore. It seems, that the node starts working just after setup() routine. Is there another possibility to run this command once after note setup/startup?
Regards
spacejay
-
Hello all,
I tried to convert the sketch from my relay node to the new version 2.0.x. In the setup() routine I set the state of the relay to off and sent the state to the controller. In version 1.5.4 worked this without problems. Now with version 2.0.0, it doesn't work anymore. It seems, that the node starts working just after setup() routine. Is there another possibility to run this command once after note setup/startup?
Regards
spacejay
-
Hello all,
I tried to convert the sketch from my relay node to the new version 2.0.x. In the setup() routine I set the state of the relay to off and sent the state to the controller. In version 1.5.4 worked this without problems. Now with version 2.0.0, it doesn't work anymore. It seems, that the node starts working just after setup() routine. Is there another possibility to run this command once after note setup/startup?
Regards
spacejay
-
@spacejay Start your loop() code like this:
void loop() { static bool first = true; if (first) { // .. Your code that should only be executed on first run .. first = false; } // .. your normal loop-contents .. } -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login