gop y ve ct den GT
#include<16f877a.h>
#fuses nowdt,noprotect,nolvp,xt,put
#use delay(clock=4000000)
#use fast_io(a)
#use fast_io(b)
#use fast_io(d)
#byte portd=0x8
#byte portb=0x6
#byte porta=0x5
#bit a0=porta.0
#bit a1=porta.1
void main()
{signed int x,y,i,chuc,dv;
int a[10]={192,249,164,176,153,146,130,248,128,144};
set_tris_a(0b00);
set_tris_b(0);
set_tris_d(0b000);
denxanh:
x=5;
portd=0b110;
goto loop;
denvang:
x=3;
portd=0b101;
goto loop;
dendo:
x=6;
portd=0b011;
goto loop;
loop:
while(1)
{chuc=x/10;
dv=x%10;
for(i=0;i<50;i++)
{portb=a[chuc];
a0=0;
a1=1;
delay_ms(10);
portb=a[dv];
a1=0;
a0=1;
delay_ms(10);
}x--;
if(x>=0)
goto loop;
else
y=portd;
switch(y)
{case 6:
{goto denvang;
break;}
case 5:
{goto dendo;
break;}
case 3:
{goto denxanh;
break;}}}}
|