Refer Seven Segment 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()
{
while(1)
{
unsigned char i,a[10] = {0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92,
0x82, 0xf8, 0x80, 0x90};
for(i=0;i<10;i++)
{
P1=a[i];
ms_delay(500);
}
}
}
#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()
{
while(1)
{
unsigned char i,a[10] = {0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92,
0x82, 0xf8, 0x80, 0x90};
for(i=0;i<10;i++)
{
P1=a[i];
ms_delay(500);
}
}
}
0 comments:
Post a Comment