Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By sjesp
#78259 Hi
Can you explain this code, I don't get it. (lines 2 - 6)

1 while (WiFi.status() != WL_CONNECTED) {
2 extButton();
3 for(int i = 0; i<500; i++){
4 extButton();
5 delay(1);
6 }
7 Serial.print(".");
8 }

Thanks S J
User avatar
By merkelck
#80824
rutierut wrote:Variation on my other thread

Relay with button
[/i]

I sure hope I haven't made a big mess here but I would like to know more about this code. I am sure that this is dumb question but where does this go? On a esp8266xxx device or on the sonoff device. I am looking to build a handheld remote device to control (on/off) a single sonoff switch that I have connected to my home system via mosquitto and Node RED. The Node Red and MQTT are running on a RPi3. I want the LED on the sonoff to control the led on my remote to verify the device actually worked. Could someone just explain to me how this code was meant to be used?
Thank you