Refer Double Seven Segment Circuit
#include<reg51.h>
#include<intrins.h>
void ms_delay(unsigned int a)
{
unsigned char b=255;
for(;a-->0;)
for(;b-->0;)
_nop_();
}
void main()
{
unsigned char x,y,j,i,a[10]= {0xc0, 0xf9, 0xa4, 0xb0, 0x99,
0x92, 0x82, 0xf8, 0x80, 0x90};
while(1)
{
for(i=0;i<99;i++)
{
x=i%10;
y=i/10;
for(j=0;j<60;j++)
{
t2=1;
t1=0;
P2=a[x];
ms_delay(10);
t2=0;
t1=1;
P2=a[y];
ms_delay(10);
}
}
}
}
0 comments:
Post a Comment