d var byte
e var byte
f var byte
TRISA = 1
TRISB = 0
portb=0
d=0
e=0
f=0
test:
button porta.0,0,254,0,d,1,sag
button porta.1,0,254,0,e,1,sol
goto test
sol:
button porta.2,0,254,0,f,1,test
portb= %11000110
pause 10
portb = %01000011
pause 10
portb= %01001001
pause 10
portb= %11001100
pause 10
portb=0
button porta.0,0,254,0,d,1,sag
goto sol
sag:
button porta.2,0,254,0,f,1,test
portb= %00110011
pause 10
portb= %00100110
pause 10
portb= %00101100
pause 10
portb= %00111001
pause 10
portb=0
button porta.1,0,254,0,e,1,sol
goto sag