这是驱动数码管的程序,调用就行了
/**************************************************************************/
void write_451(unsigned char add,unsigned char x)
{
DIN_451=0;DIN_451=1;
B=x;
DIN_451=B0;DCLK_451=0;DCLK_451=1;
DIN_451=B1;DCLK_451=0;DCLK_451=1;
DIN_451=B2;DCLK_451=0;DCLK_451=1;
DIN_451=B3;DCLK_451=0;DCLK_451=1;
DIN_451=B4;DCLK_451=0;DCLK_451=1;
DIN_451=B5;DCLK_451=0;DCLK_451=1;
DIN_451=B6;DCLK_451=0;DCLK_451=1;
DIN_451=B7;DCLK_451=0;DCLK_451=1;
B=add;
DIN_451=B0;DCLK_451=0;DCLK_451=1;
DIN_451=B1;DCLK_451=0;DCLK_451=1;
DIN_451=B2;DCLK_451=0;DCLK_451=1;
DIN_451=B3;DCLK_451=0;DCLK_451=1;
LOAD_451=0;LOAD_451=1;
}