下载此文档

LCD液晶万年历显示程序.doc


文档分类: | 页数:约5页 举报非法文档有奖
1/5
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/5 下载此文档
文档列表 文档介绍
#include <>
sbit RS=P2^6;
sbit rw=P2^5;
sbit LCDE=P2^7;
unsigned char n;
unsigned char shi,ge,fen,miao,count;
unsigned int year,yue,ri;
//unsigned char code table[]=" 2011-8-4 MON ";
void delay(unsigned int xms)
{
unsigned int i,j;
for(i=xms;i>0;i--)
for(j=110;j>0;j--);
}
void (unsigned )
{
RS=0;
rw=0;
LCDE=0;
;
delay(5);
LCDE=1;
delay(5);
LCDE=0;
}
void write_date(unsigned char date)
{
RS=1;
rw=0;
LCDE=0;
P0=date;
delay(5);
LCDE=1;
delay(5);
LCDE=0;
}
void write_sfm(unsigned char add,unsigned char date)
{
unsigned char shi,ge;
shi=date/10;
ge=date%10;
(0x80+0x40+add);
write_date(shi+0x30);
write_date(ge+0x30);
}
void write_n(unsigned int add1,unsigned int date1)
{
unsigned int q,b,s,g;
q=date1/1000;
b=date1/100%10;
s=date1/10%10;
g=date1%10;
(0x80+add1);
write_date(q+0x30);
write_date(b+0x30);
write_date(s+0x30);
write_date(g+0x30);
}
void write_yr(unsigned char add2,unsigned char date2)
{
unsigned char s1,g1;
s1=date2/10;
g1=date2%10;
(0x80+add2);
write_date(s1+0x30);
write_date(g1+0x30);
}
void init()
{
LCDE=0;
fen=35;
miao=34;
shi=15;
ri=4;
yue=8;
year=2011;
(0x38);
(0x0c);
(0x06);
(0x01);
(0x80+7);
write_date('-');
delay(5);
(0x80+10);
write_date('-');
write_n(3,year);
write_yr(8,yue);
write_yr(11,ri);
delay(5);
(0x80

LCD液晶万年历显示程序 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数5
  • 收藏数0 收藏
  • 顶次数0
  • 上传人mh900965
  • 文件大小33 KB
  • 时间2018-03-17