You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
1Forgot to mention: Defining it outside of loop() in the global scope DOES NOT WORK! Don't ask me why, I spent hours just to find this problem. This is the reason why I wanted to use static in the first place. Will edit my post. And concerning the name "now": It's just what they used in the example, I won't use it, but good point!blackdaw– blackdaw2020年04月22日 19:54:18 +00:00Commented Apr 22, 2020 at 19:54
-
I updated my answer, just try if it helps.Michel Keijzers– Michel Keijzers2020年04月22日 20:10:42 +00:00Commented Apr 22, 2020 at 20:10
-
1Re "I suspect, the constructor calls a function that uses variables or a function that is not initialized at that point": I can't see anything wrong in this constructor.Edgar Bonet– Edgar Bonet2020年04月22日 20:34:22 +00:00Commented Apr 22, 2020 at 20:34
-
@EdgarBonet ... me neither, I'm wondering why creating it as global variable wouldn't work.Michel Keijzers– Michel Keijzers2020年04月22日 20:36:46 +00:00Commented Apr 22, 2020 at 20:36
-
See the comments above beneath @EdgarBonet 's solution. It compiles and uploads but doesn't execute.blackdaw– blackdaw2020年04月23日 17:16:07 +00:00Commented Apr 23, 2020 at 17:16
lang-cpp