Interfacing 7 segment display with 8051



Please find the code details below:

#include<reg51.h>
# define segment P2
void delay(unsigned int ms)
{
int i,j;
for(i=0;i<ms;i++)
for(j=0;j<1275;j++);
}
void main()
{
unsigned char i,array[] = {0x3F,0X06,0X5B,0X4F,0X66,0X6D,0X7D,0X07,0X7F,0X6F};
while(1)
{
for(i=0;i<10;i++)
   {
          segment = array[i];
  delay(100);
       }
     }
}  

Thank You :)

Comments

Popular posts from this blog

How to make robot car using 8051

Led Chaser using 8051