I am fairly new to arduino and ESP though am very familiar with css and javascript.
I have an esp webserver that includes a button
client.print("<button style='background-color: #F30C0C; color:#000;'></button>");
but need it to change the css backbround-color when pin is reading HIGH
if (c == '\n') {
currentLineIsBlank = true;
buffer = "";
}
else if (c == '\r') {
if (buffer.indexOf("GET /?relay1") >= 0)
relayPIN1read = digitalRead(relayPIN1);
if (relayPIN1read == HIGH) {
digitalWrite(relayPIN1, LOW);
}
if (relayPIN1read == LOW) {
digitalWrite(relayPIN1, HIGH);
}
}
}
Does any one know of any way to do this?