标题: proteus中ds1302时钟程序仿真 [打印本页]

作者: 51黑ff    时间: 2016-8-20 21:00
标题: proteus中ds1302时钟程序仿真
proteus ds1302时钟程序仿真原理图


proteus中ds1302时钟程序仿真.rar (106.41 KB, 下载次数: 31)
部分时钟程序预览:

  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("Date: ");
  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. }
复制代码




作者: xtt2543503943    时间: 2016-8-22 14:45
可以,下了好使




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