#include <reg52.h>
void delay(unsigned int i); //声明延时函数
main()
{
unsigned char Num = 0xff;
while (1)
{P1 = Num;
delay(1000); //延时函数
Num--;
}
}
/*******延时函数*************/
void delay(unsigned int i)
{
unsigned char j;
for(i; i > 0; i--)
for(j = 255; j > 0; j--);
}
|