-->
Page 1 of 1

Asynchronous WiFi

PostPosted: Thu Jul 23, 2015 7:51 am
by Richard210363
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

Re: Asynchronous WiFi

PostPosted: Sat Aug 08, 2015 3:45 am
by pelrun
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.