fara793
Newbie level 4
i need help
I am working on a project, but i dont know very much on mikrobasic, however, if someone can help me, i would be very grateful..
i am working on pic16f877A, and here is the program but its not working : can you please if out whats wrong?
end.
THANK YOU!!
I am working on a project, but i dont know very much on mikrobasic, however, if someone can help me, i would be very grateful..
i am working on pic16f877A, and here is the program but its not working : can you please if out whats wrong?
Code:
PORTA=0
TRISA=0
PORTD=0
TRISD=0
PORTB=0
TRISB=255
main:
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.
THANK YOU!!