#include<reg52.h>
#define uint unsigned int
uint a,i,j;
sbit dawr=P3^6;
sbit csda=P3^2;
sbit dula=P2^6;  //定义数码管段选
sbit wela=P2^7;  //定义数码管位选
void delay(uint);
void main()
{
	csda=0;
	dawr=0;
	dula=0;  //关数码管段选
	wela=0;  //关数码管位选
	while(1)
	{
		for(a=0;a<256;a++)
		{
			P0=a;
			delay(10);
		}
	}
}

void delay(uint x)
{
	for(i=x;i>0;i--)
	{
	for(j=120;j>0;j--);
	}
}