标题: Proteus模拟单片机+1602电子表 [打印本页]

作者: 强强QAQ    时间: 2019-3-14 18:53
标题: Proteus模拟单片机+1602电子表
新人一位,自己弄了一星期,希望大家多多指教。

单片机源程序如下:
  1. #include <REGX52.H>
  2. #include "LCD1602.h"
  3. #include "DS1302.h"

  4. void Delay1ms(unsigned int count)
  5. {
  6.         unsigned int i,j;
  7.         for(i=0;i<count;i++)
  8.         for(j=0;j<120;j++);
  9. }

  10. main()
  11. {
  12.         SYSTEMTIME CurrentTime;
  13.         LCD_Initial();
  14.         Initial_DS1302();

  15.         GotoXY(0,0);
  16.         Print("Data: ");
  17.         GotoXY(0,1);
  18.         Print("Time: ");
  19.         while(1)
  20.         {
  21.                 DS1302_GetTime(&CurrentTime);
  22.                 DateToStr(&CurrentTime);
  23.                 TimeToStr(&CurrentTime);
  24.                 GotoXY(6,0);
  25.                 Print(CurrentTime.DateString);
  26.                 GotoXY(6,1);
  27.                 Print(CurrentTime.TimeString);

  28.                 Delay1ms(300);
  29.         }
  30. }
复制代码

所有资料51hei提供下载:
project.rar (129.69 KB, 下载次数: 15)








欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1