標題: proteus中ds1302時鐘程序仿真 [打印本頁]

作者: 51黑ff    時間: 2016-8-20 21:00
標題: proteus中ds1302時鐘程序仿真
proteus ds1302時鐘程序仿真原理圖


proteus中ds1302時鐘程序仿真.rar (106.41 KB, 下載次數(shù): 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.torrancerestoration.com/bbs/) Powered by Discuz! X3.1