fbpx

Interface led With 8051

Led have two pins Anode(+) and Cathode(-), Anode connected with 89C51 P1.0 pin and Cathode is connected with 5v in Series with 220 ohm resistor.

  • Anode is Positive node of led
  • Cathod is negative node of led

Hardware Required

  • Led.
  • 220 ohms Resistor
  • 8051 microcontroller

Circuit

Virtual Circuit

Code

#include <REGx51.h> 
void delay()
{
int i,j;
for(i=0;i<1000;i++)
{
for(j=0;j<100;j++);
}
}
void main()
{
P1_3=1;
delay();
P1_3=0;
delay();
}

Leave a Reply

Your email address will not be published. Required fields are marked *