- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
lcd1602液晶显示电子时钟(LCD1602 liquid crystal display electronic clock)
lcd1602液晶显示电子时钟(LCD1602 liquid crystal display electronic clock)
LCD1602 liquid crystal display electronic clock
Heroes and heroes, happy New Year!
I learn C language soon today to write a clock program, found when debugging, manual adjustment is completely normal, but in the automatic time, date and week is inconsistent with the facts, please help me, thank you, the following source program
#include AT89X52.H
#define uchar unsigned char
#define uint unsigned int
Sbit rs=P2^0;
Sbit RW=P2^1;
Sbit lcden=P2^2;
Sbit s1=P1^5;
Sbit s2=P1^6;
Sbit s3=P1^7;
Uchar, count, s1num;
Char, Miao, Shi, Fen, W, R, y, a;
Uchar code table[]= 2009-01-29 W4;
Uchar code table1[]= 00:00:00;
Void delay (uint z) / / delay procedures
{
Uint, x, y;
For (x=z; x0; x--)
For (y=110; y0; y--);
}
Void write_com (uchar com) / / write commands to the 1602 LCD
{
RW=0;
Rs=0;
Lcden=0;
P0=com;
Delay (5);
Lcden=1;
Delay (5);
Lcden=0;
}
Void write_date (uchar date) / / write data to the 1602 LCD
{
RW=0;
Rs=1;
Lcden=0;
P0=date;
Delay (5);
Lcden=1;
Delay (5);
Lcden=0;
}
Void (init) / / initialize
{
Uchar num;
Lcden=0;
Write_com (0x38); / / set the display mode
Write_com (0x0c); / / open display
Write_com (0x06); / / when writing time automatic plus 1
Write_com (0x01); / / screen display
Write_com (0x80); / / pointer data set
For (num=0; num15; num++) / / set the first line digital position
{
Write_date (table[num]); / / the first line of digital display
Delay (5);
}
Write_com (0x80+0x40); / / set the next display second lines
For (num=0; num12; num++) / / set the second row position
{
Write_date (table1[num]); / / digital display second lines
Delay (5);
}
TMOD=0x01; / / set the timer function 1
TH0= (65536-50000 /256); / / timer initial loading
TL0= (65536-50000)%256;
EA=1; / / open interrupt
ET0=1; / / T0 timer interrupt
TR0=1; / / start timer
}
Void write_sfm (uchar add, uchar date) when the separation / /
{
Uchar Shi, Ge; / / set a bit, ten bit variable
Shi=date/10; / / from ten
Ge=date%10; / / from a
Writ
您可能关注的文档
- 03.3.牛顿第二定律(03.3. Newton's second law).doc
- ++兰州大学风雨百年发展历程_卫视_凤凰网2().doc
- 007_黄仁宇现象(007_ Huang Renyu phenomenon).doc
- 002机械挖土施工工艺(002 mechanical excavation construction technology).doc
- 007如何创建html表格(007 how to create a HTML table).doc
- 008_盼(008_ look forward to).doc
- 0.5元(0.5 yuan).doc
- 033牛顿第二定律(033 Newton's second law).doc
- 002汽车美容店投资创业方案(002 auto beauty shop investment venture program).doc
- 04 配套cad笔记(04 matching CAD notes).doc
- led应用技术知识培训(LED application technology knowledge training).doc
- lighters中英双文(打火机中英双文).doc
- kpi绩效量化考核落地实施11480(KPI performance quantitative assessment landing implementation 11480).doc
- linux 字符串转换篇(Linux string conversion chapter).doc
- linux rpm卸载参数(Linux RPM uninstall parameters).doc
- linux 下svn图形客户端smartsvn 安装(Svn graphical client smartsvn installation under Linux).doc
- linux下解压命令大全 - eoiioe - 博客园(Linux decompression command Daquan - eoiioe - blog).doc
- linux下载文件命令(Linux download file command).doc
- linux入门的建议(Linux tips for getting started).doc
- linux发行版本及其特点(Linux release and its features).doc
最近下载
- 体例格式8:工学一体化课程《windows服务器基础配置与局域网组建》任务3学习任务考核方案.docx VIP
- 石方破碎开挖施工组织设计.pdf VIP
- TCCPA-陆上风力发电机组钢混塔架施工与质量验收规范.pdf VIP
- 2025年浙江省江山市中考数学试题及参考答案详解【新】.docx VIP
- 支持性护理对结直肠癌术后结肠造口患者生活质量改善情况分析.pdf VIP
- Goodrive300-01A系列空压机专用变频器说明书.pdf
- 跨境电商平台创业计划书.docx VIP
- 智能制造系统建模与仿真 课件 第1章 智能制造技术的产生及发展.pptx
- 2025年辅警招聘公安基础知识100题及答案.pdf VIP
- 砂浆及砌块原始记录.docx VIP
文档评论(0)