Pages

Powered By Blogger

Saturday, 11 June 2011

LED


#include<reg51.h>
#define led P0
void delay(unsigned char);
void main()
{
P0=0xff;
while(1)
{
led=0x55;
delay(10);
led=0xAA;
delay(10);
}
}
void delay(unsigned char b)
{
unsigned char i,j;
for(i=0;i<5;i++)
for(j=0;j<b;j++);
}

No comments: