void loop()
{
//change the led status with a button START
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH && lastButtonState == LOW) {
delay(50);
if (ledState == 0) {
digitalWrite(led, HIGH);
ledState = 1;
}
else {
digitalWrite(led, LOW);
ledState = 0;
}
}
lastButtonState = buttonState;
//change the led status with a button END
//change led status with a wifi received order START
if (finder.find("led1off") ){
digitalWrite(led, LOW);
ledState = 0;
}
if (finder.find("led1on") ){
digitalWrite(led, HIGH);
ledState = 1;
}
//change led status with a wifi received order end
}
the wifi received part, works perfect, but the button doesn't. If i put only the button code, it works, but it doesn't work if i put it all together. Sometimes turn on/off and sometime makes esp8266 reset. Please help.