1.功能描述
AT89c51板子
2.程序
#include <REGX51.H>
#define uchar unsigned char
#define uint unsigned int
void delay(uint ms);
void main(void)
{
int l=0;
while(1)
{
for(l=0;l<20;l++)
{
P1=0xfe;
delay(250);
P1=0xfc;
delay(250);
P1=0xf8;
delay(250);
P1=0xf0;
delay(250);
}
for(l=0;l<15;l++)
{
P1=0xe0;
delay(250);
P1=0x80;
delay(250);
P1=0x70;
delay(250);
P1=0x60;
delay(250);
P1=0x50;
delay(250);
}
}
}
void delay(uint ms)
{
uchar i;
uint j;
for(j=0;j<ms;j++)
for(i=0;i<125;i++)
;
}
3.原理图