Try New Document
Seven segment display using at89c51 microcontroller.
port P2 is used for connection as per fig given below.
#include
sbit sw=P1^0;
void delay(unsigned int t)
{
while(t--);
}
void main()
{
int i;
unsigned char ar[10]= {0x3F,0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F};
P2=0x00;
while(1)
{
while(sw==1);
while(sw==0);
for(i=0; i<10;i++) { P2=ar[i]; delay(500000); } } } If any query ask me in comment.
port P2 is used for connection as per fig given below.
#include
sbit sw=P1^0;
void delay(unsigned int t)
{
while(t--);
}
void main()
{
int i;
unsigned char ar[10]= {0x3F,0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F};
P2=0x00;
while(1)
{
while(sw==1);
while(sw==0);
for(i=0; i<10;i++) { P2=ar[i]; delay(500000); } } } If any query ask me in comment.
Comments
Post a Comment