1.功能描述
2程序
#include "reg51.h"
#define uchar unsigned char
#define uint unsigned int
void delay(uint ms);
void main(void)
{
int k=0;
while(1)
{
for(k=0;k<20;k++)
{
P1=0xfe;
delay(50);
P1=0xfd;
delay(50);
P1=0xfb;
delay(50);
P1=0xf7;
}
delay(500);
P1=0xef;
delay(50);
P1=0xdf;
delay(50);
P1=0xbf;
delay(50);
P1=0x7f;
delay(50);
}
}
void delay(uint ms)
{
uchar i;
uint j;
for(j=0;j<ms;j++)
for(i=0;i<125;i++)
;
}