Turn on led only from button but not from web interface

Hi everyone,
i manage to control 2 leds from buttons and from the web server on the arduino.
What i am trying to accomplish now is that i want the led to turn on only from the button (and if i press it once more not to do anything) and turn it off from the web interface (i dont want to be able to turn it on from the web interface)
Any way to implement something like this to my code?
In the attachment you can find my code.
Thank you in advance.

arduino code.txt (10.7 KB)

You could take out the part that checks for "LED1=1" so the web page can't turn LED1 on.

To keep the button from turning the LED off you would have to change this part which toggles the LED when the button is pressed:

                // only toggle the LED if the new button state is HIGH
                if (buttonState[i] == HIGH) {
                    LED_state[i] = !LED_state[i];
                }

You should edit the index.htm file on your SD card to remove the part of the web page that lets you turn the LED on.

The html part was easy, i can only turn it off from the web, but i havent managed the button part.
Whatever i tried pushing the button 2nd time turns the led off. Is there anythin else i could look at?
Thank you once more.

johnym30:
i havent managed the button part.
Whatever i tried pushing the button 2nd time turns the led off. Is there anythin else i could look at?

To keep the button from turning the LED off you would have to change this part which toggles the LED when the button is pressed:

                // only toggle the LED if the new button state is HIGH
                if (buttonState[i] == HIGH) {
                    LED_state[i] = !LED_state[i];
                }

That part seems to tell us that only if the button state is high toggle it.
I changed it to low, but it seems to work the same way.

johnym30:
That part seems to tell us that only if the button state is high toggle it.
I changed it to low, but it seems to work the same way.

If the LED_state is HIGH and you toggle it. What happens? It goes LOW.
If you don't want the LED_state to go LOW, don't toggle it when it is HIGH.
Or don't toggle it at all. Just set it HIGH.

I think i got it !!!!!!!

if (buttonState[i] == HIGH) {
                    LED_state[i] = HIGH;
                }

It seems to be working as expected.
Thank you very much for your help.