Home / MI Lab / Micocontroller / 8051 / Different LED Pattern Effect using 8051 Micro-controller

Different LED Pattern Effect using 8051 Micro-controller

 

LED Pattern Effect using 8051

 

Here are the 8 different types of codes made on LED controlled by 8-bit micro-controller. It is posted to enhance your programming skills on 8051 as basic skills are developed on LED interfacing with 8051 only.

 

Picture1 (2)

Try to make your own programs and different method to develop new ways to solve the problems which will enhance your skills more.

Parts Used :

8051  Microcontroller,

LED Bar Graph

Software Used: 

Proteus ISI

Keil

 

 

1. Blink LED

#include <reg51.h>

void delay()
{
unsigned int i;
for(i=0;i<1000;i++)
{
}
}

void main()
{
while(1)
{
P1=0xff;
delay();
P1=0x00;
delay();
}
}

 

2. Alternative/ Dancing pattern:

#include <reg51.h>

void delay()
{
unsigned int i;
for(i=0;i<1000;i++)
{
}
}

void main()
{
while(1)
{
P1=0xAA;
delay();
P1=0x55;
delay();
}
}

 

3.Curtain effect:

#include <reg51.h>
void delay()
{
unsigned int i,j;
for(i=0;i<1000;i++)
{
for(j=0;j<20;j++)
{

}

}
}

void main()
{
while(1)
{
P1=0x81;
delay();
P1=0xC3;
delay();
P1=0xE7;
delay();
P1=0xFF;
delay();
P1=0xE7;
delay();
P1=0xC3;
delay();
P1=0x81;
delay();
P1=0x00;
delay();

}
}

 

About Keval Chaudhari

I have recently passed my Bachelor of Engineering in Mechanical Branch. I have expertise in CAD system. Also, I am interested to make new things.

Check Also

Semiconductor Basics

Semiconductor Basics

                         Semiconductor Basics Introduction   Resistivity   Conductors   Insulators   Semiconductor Basics   Semiconductor …

Leave a Reply

Be the First to Comment!

Notify of
wpDiscuz