Hello forum friends,
I have 4 buttons connected to PORTB and 4 LEDs to PORTB, I turn on and off with the same button for the LED but independently, with this code does not work properly any suggestions?.
Code:
start:
IF PORTB.0=0 then
HIGH PORTB.4
WHILE PORTB.0=0 : Wend : pause 50
ENDIF
IF PORTB.0=0 then
LOW PORTB.4
WHILE PORTB.0=0 : Wend : pause 50
ENDIF
iF PORTB.1=0 then
HIGH PORTB.5
WHILE PORTB.0=0 : Wend : pause 50
ENDIF
IF PORTB.1=0 then
LOW PORTB.5
WHILE PORTB.0=0 : Wend : pause 50
ENDIF
iF PORTB.2=0 then
HIGH PORTB.6
WHILE PORTB.0=0 : Wend : pause 50
ENDIF
IF PORTB.2=0 then
LOW PORTB.6
WHILE PORTB.0=0 : Wend : pause 50
ENDIF
iF PORTB.3=0 then
HIGH PORTB.7
WHILE PORTB.0=0 : Wend : pause 50
ENDIF
IF PORTB.3=0 then
LOW PORTB.7
WHILE PORTB.0=0 : Wend : pause 50
ENDIF
goto start
Bookmarks