Menu

Custom Search

Microcontroller Program

#include<8051.h>


void delay(int n)
{
unsigned int i,j;
for(i=0;i for(j=0;j<65000;j++);
}


void main()
{
unsigned char inp;
P2_0=0;
P1_0=0;

while(1)
{
inp=P2_0;
if(inp==1)
{
while(1)
{
P1_0=1;
delay(1);
P1_0=0;
delay(1);
}
}
}
}

No comments:

Post a Comment