Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Richard210363
#24010 Hi,
I have a working ESP8266 and a nice sketch controlling the colours of a NeoPixel strip from a web browser using these includes:
NeoPixelBus.h
RgbColor.h
ESP8266WiFi.h
WiFiClient.h
ESP8266WebServer.h

Can I receive new data from the WiFi and "interrupt" code in the void loop() ?
Specifically I run a while(true) loop to make the LEDs in the NeoPixel ring rotate between data reception. At the moment this blocks so I can't receive any new data (or at least I can't act on any new data received)

Is there an Interrupt system or shared variables I can set and detect?
I am used to Arduino code but perhaps this requires LUA?

Any thoughts welcome
User avatar
By pelrun
#25342 You need to add either a yield() or a delay(x) (yield is identical to delay(0)) inside your while loop to give the wifi and other housekeeping functions a chance to run.