المشكله انه ما بصير تعمل
for portb=9 to 0 step -1
.
.
.
next portb
التصحيح انه اتبدل portb في متغير وتعطي ال portb دايما قيمة هاد المتغير
كود:
program sa
dim i,x,sss as byte
main:
trisb=0
trisd=%00000011
portb=0
for sss=9 to 0 step -1
portb=sss ''''''''''''''' the same
if portd.0=0 then
while portd.0=0
wend
for x=0 to 9
portb=x
delay_ms(1000)
next x
end if
if portd.1=0 then
while portd.1=0
wend
for i=9 to 0 step -1
portb=i
delay_ms(1000)
next i
portb=9
end if
delay_ms(500)
next sss
end.