
Originally Posted by
Gurkan-demirbas
How have you connected the switch to the Port pin?
When you press the button; which logic level occurs on the pin? 5 Volt? 0 Volt?
Well if the port pin gets 5 volt when you press, ==> your btfss is wrong; How?
btfss SWPORT, SW1 ==> test SW1 and skip the next, if it is Logic1 (5 Vdc);
call Switch1 ==> if the pin is Logic0 (0 Vdc) then this command will be executed because of the previous.
Then, it will turn on the lights.
Change your hardware, or the simpler way is to change your code to....
btfsc SWPORT, SW1
call Switch1
The situation is the same for the other SWs and also other LEDs
GurkaN
Bookmarks