top of page
Search

Project Name: Blinking led's using 8051 Micro-Controller

sujata redkar

SOFTWARE: KEIL MICRO VISION 4



SIMULATOR: PROTEUS 8.0



CIRCUIT DIAGRAM:



CIRCUIT WORKING:


This project is about blinking led's which are connected to port 1.0 and port 1.1 pins of port 1.

I have designed this circuit as a current sinking circuit.So in order to turn ON the led's I have provided 0V(logic 0)and for turning OFF the led's 5V(logic 1) is provided to the respective pins.I have alternatively turn the leds ON and OFF and provided the delay in between the interval of ON and OFF so that blinking is visible.


PROGRAM:


#include<reg51.h>
sbit led1 = P1^0;
sbit led2  = P1^1;
void delay(int d);
void main()
{
P1=0xfc;    //  set port 1.0 and port 1.1 as output
led1=1;    
led2=1;
while(1)       //continuous loop
{
led1 = 0;      // turn on the led1
led2 =1;     // turn off the led 2
delay(10);   // delay of 100 mili seconds
led1=1;    // turn off the led1
led2=0;   // turn on the led2
delay(10);
}
}
void delay(int d)       // delay code
{
int i;
for(i=0;i<d*1274;i++);
}


PROGRAM DESCRIPTION:


At starting I have make both the led's off by providing logic 1 to led1 (port1.0)and led2 (port1.1) respectively.Then for a continuous process I have used while loop.

After that I have make led1(port1.0) ON by providing logic 0 and led2(port1.1) OFF by providing logic 1.Then I have provided delay of around 100 milisecond approx.Then again I have provided logic 1 to led 1(port1.0) to turn it OFF and logic0 to led2 to turn it ON.Again I have provided the delay.


VIDEO:








20 views0 comments

Comentarios


bottom of page