program something
main:
TRISA=0
PORTA=0
TRISD=0
PORTD=0
TRISB=255
ADCON1 = 6 'OR ADCON1 = 7, SAME THING
CMCON = 7
while true
while (portB = 0)
portA =%00001100
portD =%00001001
delay_ms (2000)
portA =%00010010
portD =%00001001
delay_ms (2000)
portA =%00100001
portD =%00001001
delay_ms (2000)
portA =%00010001
portD =%00001010
delay_ms (2000)
portA =%00001001
portD =%00001100
delay_ms (2000)
portA =%00001001
portD =%00010010
delay_ms (2000)
portA =%00001001
portD =%00100001
delay_ms (2000)
portA =%00001010
portD =%00010001
delay_ms (2000)
wend
if (portB= %00000001) then
portA =%00001100
portD =%00001001
delay_ms (5000)
end if
if (portB= %00000010) then
portA =%00100001
portD =%00001001
delay_ms (5000)
end if
if (portB= %00000100) then
portA =%00001001
portD =%00001100
delay_ms (5000)
end if
if (portB= %00001000) then
portA =%00001001
portD =%00100001
delay_ms (2000)
end if
wend
end.