How do I save the color of a button that sends a python command by php?

1

Good afternoon,

I have a question, I'm doing a web server on the raspberry pi, and when I connect by the browser I have several buttons that act on the outputs of the GPIO with python and with php form = post

How can I make a button once change color and remain color until you press other buttons that I decide (these will have specific ID's)

I may have to give more explanations, I hope someone will read it and can help me because I do not get it.

function setColor(btn, color){
    var count=1;
    var property = document.getElementById(btn);
    var red = 3
    if (count == 0){
        property.style.backgroundColor = "#FFFFFF"
        count=1;
    }
    else{
        property.style.backgroundColor = "#7FFF00"
        count=0;
    }

}

with this script I get it to change for a moment but I think that when the * .py is executed it changes color again and puts it back in its state.

    
asked by Jordi Bargallo 14.01.2018 в 18:08
source

0 answers