Home > other >  MCU keil4 lack some statements functions added (or wrong)
MCU keil4 lack some statements functions added (or wrong)

Time:12-02

Have a great god help see
Code up missing some statements or incorrect hex import in could run run results as shown in figure
(what) indicate the added code
# include

# define uchar unsigned char
# define uint unsigned int

Uchar int_time;
Uchar second;
Uchar minute;
Uchar hour;

Uchar date []="L.D.C HINA";
Uchar time []="time 23:59:55";
Uchar second=55 minute=59, hour=23;

Void clock_init ()
{uchar I, j;
for(i=0; i<16. I++)
[I] {write_date (date);
}
Wtite_com (0 x80 + 0 x40);
for(j=0; j<16. J++)
[j] {write_date (time); }
}

Void clock_write (uint s, uint m, uint h)
{write_sfm (0 x47, h); Write_sfm (0 x4a, m); Write_sfm (0 x4d, s);
}
Void main ()
{init1602 ();
Clock_init ();
TMOD=0 x01;
EA=1;
ET0=1;
TH0=(65536-46483)/256;
TL0=(65536-46483) % 256;
TR0=1;
Int_time=0;
Second=55;
Minute=59;
hour=23;
While (1)
{clock_write (second, minute, hour);
}
}

Void T0_interserve (void) interrupt 1
{int_time + +; If (int_time==20) {int_time=0; Second++; {} the if (second==60) second=0; minute++; {} the if (mintue==60) mintue=0; hour++; {} the if (hour==24) hour=0} TH0=(65536-46483)/256; TL0=(65536-46483) % 256;
}

CodePudding user response:

Is there a great god a look
  • Related