Wednesday, 24 July 2013

LED Blinking in 8051. ** Program for Begineers

// This is the simple program to learn Embedded systems ** Led Bliking **
#include <REGX51.H> // Header file for 8051
sbit led=P2^0;      // here in Port 2, 0th pin led is connected
delay()                // Delay program to create delay in between bliking
{
unsigned int i,j;
for (i=0;i<=300;i++)
for(j=0;j<=2000;j++);
}
void main()                // Main program
{
led=0;
while(1)                // Infinite loop
{
led=1;                //Led ON
delay();           
led=0;                // Led OFF
delay();
}
}               

You can also download c file, Click here!

No comments:

Post a Comment