#include
unsigned char code time[]={0x59,0x58,0x57,0x56,0x55,0x54,0x53,0x52,0x51,0x50,0x49,0x48,0x47,
0x46,0x45,0x44,0x43,0x42,0x41,0x39,0x38,0x37,0x36,0x35,0x34,0x33,0x32,0x31,0x30,0x29,0x28,0x27,0x26,0x25,0x24,0x23,0x22,0x21,0x20,0x19,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00};
unsigned char Second;
unsigned char timer;
unsigned char fen;
void delays()
{
unsigned char i,j,k;
for(k=100;k>0;k--)
for(i=20;i>0;i--)
for(j=248;j>0;j--);
}
void main()
{
TMOD=0X02;
EX0=1;
EA=1;
fen=47;
timer=0;
Second=34;
P2=time[Second];
P1=time[timer];
P0=time[fen];
while(1)
{
delays();
Second++;
timer++;
if(Second==59)
{
Second=34;
}
P2=time[Second];
if(timer==59)
{
++fen;
timer=0;
}
if(fen==59) fen=47;
P1=time[timer];
P0=time[fen];
}
}
void int0() interrupt 0 using 0
{
Second=34;
P2=time[Second];
}
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore