M
Membre supprimé 1
Invité
salut ,je créé un programma sous mikrobasic qui permet d'afficher les nombre sur un 3 afficheur 7 segment lorsque j'appui sur un bouton ,jusqu’à 999 mais je rencontre deux problèmes ,premièrement ,il ne détecté pas le bouton ,deuxièmement le deuxième afficheur sarrette au 9 voila la programme :
program copi1
dim i,j,k,V as byte
main:
trisb=%00000000
portb=%00000000
trisc=%00000000
portc=%00000000
trisd=%00000000
portd=%00000000
j=1
k=1
V=30
tah:
if (porta.0 = 0 ) then
for i = 0 to 9
portb=i
Vdelay_ms(V)
if (i=9) then
portb=0
portc=0
portc=j
j=j+1
if (i=9) and (j=9) then
portb=0
portc=0
portd=k
k=k+1
end if
end if
next i
else
portb=%00000000
portc=%00000000
portd=%00000000
end if
goto tah
end.
program copi1
dim i,j,k,V as byte
main:
trisb=%00000000
portb=%00000000
trisc=%00000000
portc=%00000000
trisd=%00000000
portd=%00000000
j=1
k=1
V=30
tah:
if (porta.0 = 0 ) then
for i = 0 to 9
portb=i
Vdelay_ms(V)
if (i=9) then
portb=0
portc=0
portc=j
j=j+1
if (i=9) and (j=9) then
portb=0
portc=0
portd=k
k=k+1
end if
end if
next i
else
portb=%00000000
portc=%00000000
portd=%00000000
end if
goto tah
end.