# include
Sbit ADDR0 P1=^ 0;
P1 sbit ADDR1=^ 1;
Sbit ADDR2=p ^ 2;
Sbit ADDR3 P1=^ 3;
Sbit ENLED=P1 ^ 4;
Unsigned char code LedChar []={
XFD 0 xfe, 0, 0 XFB, 0 xf7, 0 xef, 0 XDF, 0 XBF, 0 x7f,
XDF 0 XBF, 0, 0 xef, 0 xf7, 0 XFB, 0 XFD
};
Void main ()
{
Unsigned char CNT.
Unsigned char SEC;
ENLED=0;
ADDR3=1;
ADDR2=1;
ADDR1=1;
ADDR0=0;
TMOD=0 x01;
TH0=0 xb8;
TL0=0 x00;
TR0=1;
While (1)
{
If (TF0==1)
{
TF0=0;
TH0=0 xb8;
TL0=0 x00;
Cnt++;
If (cnt>=50)
{
CNT=0;
P0=LedChar (SEC),
Sec++;
If (sec>
=15){
The SEC=0;
}
}
}
}
}
CodePudding user response:
Array LedChar [] defines only 14 elements, namely LedChar [0] ~ LedChar [13], when judging conditions is sec>=15, there are two value was not obtained from the array LedChar, so will be garbled words, this is the C language array defines the basic knowledge, suggested that the building Lord, learning how to learn C language moreCodePudding user response:
Upstairs, positive solutions toif (sec>=sizeof (LedChar))
CodePudding user response:
The