admin管理员组文章数量:1794759
简易时钟keil代码
#include <REGX51.H> sbit RS=P3^0; sbit RW= P3^1; sbit E= P3^2; unsigned char s[]={\"0123456789\"}; unsigned char s0[]={\"CLOCK\"}; unsigned char count=0,sec=22,min=22,hour=5; void delay(unsigned int n) { unsigned int i=0,j=0; for(i=0;i<n;i++) { for(j=0;j<120;j++); } } void writecom(unsigned char com) { RS=0; RW=0; E=0; P2=com; delay(5); E=1; E=0; } void writedat(unsigned char dat) { RS=1; RW=0; E=0; P2=dat; delay(5); E=1; E=0; } void initlcd() { writecom(0x38); writecom(0x0c); writecom(0x06); writecom(0x01); } void display() { unsigned int i=0; unsigned temp0=0,temp1=0,temp2=0,temp3=0,temp4=0,temp5=0; temp0=hour/10; temp1=hour%10; temp2=min/10; temp3=min%10; temp4=sec/10; temp5=sec%10; writecom(0x80); delay(5); while(s0[i]!=&#
版权声明:本文标题:简易时钟keil代码 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686559350a81855.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论