1.功能描述
AT89c51板子
2.程序
#include <REGX51.H>
#define uint unsigned int
#define uchar unsigned char
sbit LED1=P1^0;
sbit LED2=P1^1;
sbit LED3=P1^2;
void delay(uint ms);
void main(void)
{
LED1=0;
LED2=1;
LED3=0;
while(1)
{
LED1=~LED1;
delay(3000);
LED2=~LED2;
delay(3000);
LED3=~LED3;
delay(3000);
}
}
void delay(uint ms)
{
uchar i;
uint j;
for(j=0;j<ms;j++)
{
for(i=0;i<125;i++)
{;}
}
}
3.原理图