找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3415|回复: 1
打印 上一主题 下一主题
收起左侧

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. }
复制代码



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏1 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:137125 发表于 2016-8-22 14:45 | 只看该作者
可以,下了好使
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表