找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4852|回复: 4
收起左侧

基于51单片机的实时时钟DS1302测试

[复制链接]
ID:241667 发表于 2017-11-5 20:30 | 显示全部楼层 |阅读模式
TIM截图20171105202831.png

#include <REGX52.H>
#include "LCD1602.h"
#include "DS1302.h"

void Delay1ms(unsigned int count)
{
        unsigned int i,j;
        for(i=0;i<count;i++)
        for(j=0;j<120;j++);
}

main()
{
        SYSTEMTIME CurrentTime;
        LCD_Initial();
        Initial_DS1302();

        GotoXY(0,0);
        Print("Date: ");
        GotoXY(0,1);
        Print("Time: ");
        while(1)
        {
                DS1302_GetTime(&CurrentTime);
                DateToStr(&CurrentTime);
                TimeToStr(&CurrentTime);
                GotoXY(6,0);
                Print(CurrentTime.DateString);
                GotoXY(6,1);
                Print(CurrentTime.TimeString);

                Delay1ms(300);
        }
}

0.png
全部资料51hei下载地址:
实时时钟DS1302测试.rar (42.95 KB, 下载次数: 26)


评分

参与人数 1黑币 +50 收起 理由
admin + 50 共享资料的黑币奖励!

查看全部评分

回复

使用道具 举报

ID:263842 发表于 2017-12-27 18:51 来自触屏版 | 显示全部楼层
那么短,值得研究
回复

使用道具 举报

ID:673631 发表于 2019-12-25 15:54 | 显示全部楼层
这个让它显示周
回复

使用道具 举报

ID:673631 发表于 2019-12-25 15:55 | 显示全部楼层
怎么在lcd上实现显示周
回复

使用道具 举报

ID:794953 发表于 2020-12-28 21:29 | 显示全部楼层

怎么在lcd上实现显示
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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