Skip to main content

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*

8
  • 1
    You should re-factor your code so it only uses one setup and loop function. Commented Apr 6, 2019 at 19:57
  • have you considered using multitasking? Commented Apr 6, 2019 at 21:10
  • @SimSon The Arduino doesn't support multitasking. It's a very basic microcontroller. It has a setup() function and a loop() function and that's it. Commented Apr 6, 2019 at 22:27
  • the OP seems to use an ESP8266. As far as I know there are libraries for multitasking. At least for the ESP32 I know for sure. Even on an atmega there are ways to implement multitasking, in my understanding the principle of multitasking has not much to do with the actual hardware. Commented Apr 6, 2019 at 22:35
  • @SimSon ESP32 has two cores, ESP8266 only one, so they're not the same Commented Apr 7, 2019 at 1:10