..

FreePrograms


C programming Tutorial 

Free C Programs, C Programs Download

  CONTACT US   ABOUT US   PRIVACY  DISCLAIMER

FREE C PROGRAMS 

What is C C vs C++ vs Java Program Structure Data Types in C Basic Rules of C & C++
Functions in C If, Else Conditions Loops in C Switch Case Arrays
Pointers Structures in C Strings in C Command Line Arguments Type Casting
Linked Lists Recursion Binary Trees Inheritance Multiple Inheritance
Templates File I/O Object Oriented Programming  Data Structures in C C interview Questions

/* LED Blink: C Programming and 8051.*/


Here is a simple program to blink leds using Embedded C.

#include<89v51reg.h>

void DeadDelay(unsigned int delay)
{
unsigned int indexI,indexJ;

for(indexI=0; indexI<1000; indexI++)
for(indexJ=0; indexJ<delay; indexJ++);
}


void main(void)
{
while (1)
{

/* Blink LED 2 */
P3_1 = 0;
DeadDelay(40);
P3_1 = 1;
DeadDelay(40);

/* Blink LED 1 */
P3_0 = 0;
DeadDelay (40);
P3_0 = 1;
DeadDelay(40);
}
}

 

 

 

COPYRIGHT 2009 ALL RIGHTS RESERVED FREECPROGRAMS.COM