when I press a button and hold it the led diode is on.That is OK.when I release a button led is off.
Is it possible to make that when the button is pressed and hold, led is on, and when I connect 5V to pin PORTD.7 then led is off.
I dont now how to explain a problem.
When I press a button window is opening and when it is full open then he must stop .Stop signal is connect to PORTD.7



'-----------------------OPEN WINDOW ------------------------------------------------------
IF BUTTON_STATE[2] THEN
IF BUTTON_STATE[2] >4 then
PORTD.0=1
else
PORTD.0=0
BUTTON_STATE[2]=0
endif
endif