-->
Page 6 of 6

Re: Fully working MQTT examples

PostPosted: Sun Sep 16, 2018 3:16 pm
by sjesp
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

Re: Fully working MQTT examples

PostPosted: Tue Feb 26, 2019 9:11 pm
by merkelck
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