To turn LED ON using 8051 Micro-Controller


SOFTWARE: KEIL MICRO VISION 4

SIMULATOR: PROTEUS 8.0

CIRCUIT DIAGRAM:




CIRCUIT WORKING:


This project is about turning on the led which is connected to port 1.0 of port 1.
I have designed this circuit as a current sinking circuit.So in order to turn ON the led,I have provided 0V(logic 0) on port 1.0.



PROGRAM:


#include<reg51.h>

sbit led1 = P1^0;

void main()

{

P1=0xfc; // set Port 1.0 as output

led1=1; // initially turn off the led

while(1) //continuous loop

{

led1 = 0; // turn on the led1

}

}



PROGRAM DESCRIPTION:


At starting I have make turned off the led by providing logic 1 (Port1.0).Then for a continuous process,I have used while loop.After that I have turned ON the led by providing logic 0.



VIDEO:






Comments

Popular posts from this blog

Digital Thermometer using 8051 and ADC 0808 Interfacing With 8051

how to display numbers on lcd?

To display custom characters on the lcd using 8051 micro-controller.