/***********************短延时*******************************/
void ShortDelay(void)
{ uchar x,y;
for(x=0;x<5;x++)
for(y=0;y<125;y++)
_Nop();
return;
}
/**********************数码管显示函数*************************/
void display_led(uchar number)
{ uchar buffer[4]={0,0,0,0};
uchar x,y,dat;
if(number<100)
{ buffer[0]=buffer[2]=number/10;
buffer[1]=buffer[3]=number%10;
}
else
{ if(number==100)
buffer[0]=buffer[1]=buffer[2]=buffer[3]=0x0B;
else buffer[0]=buffer[1]=buffer[2]=buffer[3]=0x0A;
}
for(x=0;x<4;x++)
{ dat=led_dat[buffer[x]];
for(y=0;y<8;y++)
{ clk_pin = 0;
论文范文http://www.chuibin.com/ if (dat & 0x01)
dat_pin=1;
else dat_pin=0;
clk_pin = 1;
_Nop();_Nop();
clk_pin = 0;
dat>>=1;
}本文来自辣.文,论-文·网原文请找腾讯3249.114
}
}
/************************** 取最小设置时间 *******************/
uchar little_time(uchar a, uchar b, uchar c, uchar d)
{ uchar little;
if(a <= b) little = a;
else little = b;
if(c < little) little = c;
if(d < little) little = d;
return little;}