完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
void display_num(uchar adder,uchar num)//在第三行的左半屏写0-9数字
{ uchar i; write_lcom(0xbc); write_lcom(0x40+(adder-1)*8); for(i=num*16;i<8+num*16;i++) { write_ldate(~tablenum[i]); } write_lcom(0xbd); write_lcom(0x40+(adder-1)*8); for(i=num*16;i<8+num*16;i++) { write_ldate(~tablenum[i+8]); } } void display_date(uchar ye,uchar lie, uchar code table[])//在液晶的第ye页第lie列显示table[]所代表的字符 { uchar i ; if(lie<5)//在左半屏显示 { write_lcom(0xb8+(ye-1)*2); write_lcom(0x40+(lie-1)*16); for(i=0;i<16;i++) { write_ldate(~table[i]); } write_lcom(0xb9+(ye-1)*2); write_lcom(0x40+(lie-1)*16); for(i=0;i<16;i++) { write_ldate(~table[i+16]); } } if(lie>4)//在右半屏显示 { write_rcom(0xb8+(ye-1)*2); write_rcom(0x40+(lie-5)*16); for(i=0;i<16;i++) { write_rdate(~table[i]); } write_rcom(0xb9+(ye-1)*2); write_rcom(0x40+(lie-5)*16); for(i=0;i<16;i++) { write_rdate(~table[i+16]); } } } //在液晶的第ye行第lie列显示字符table前后留有半空格方便字符的居中 void display_ban(uchar ye,uchar lie, uchar code table[]) { uchar i ; if(lie<4)//左半屏显示 { write_lcom(0xb8+(ye-1)*2); write_lcom(0x40+(lie)*16-8); for(i=0;i<16;i++) { write_ldate(~table[i]); } write_lcom(0xb9+(ye-1)*2); write_lcom(0x40+lie*16-8); for(i=0;i<16;i++) { write_ldate(~table[i+16]); } } if(lie>4)//右半屏显示 { write_rcom(0xb8+(ye-1)*2); write_rcom(0x40+(lie-4)*16-8); for(i=0;i<16;i++) { write_rdate(~table[i]); } write_rcom(0xb9+(ye-1)*2); write_rcom(0x40+(lie-4)*16-8); for(i=0;i<16;i++) { write_rdate(~table[i+16]); } } if(lie==4) { write_lcom(0xb8+(ye-1)*2); write_lcom(0x40+(lie)*16-8); for(i=0;i<8;i++) { write_ldate(~table[i]); } write_lcom(0xb9+(ye-1)*2); write_lcom(0x40+lie*16-8); for(i=0;i<8;i++) { write_ldate(~table[i+16]); } write_rcom(0xb8+(ye-1)*2); write_rcom(0x40); for(i=0;i<8;i++) { write_rdate(~table[i+8]); } write_rcom(0xb9+(ye-1)*2); write_rcom(0x40); for(i=0;i<8;i++) { write_rdate(~table[i+16+8]); } } }
|
|
相关推荐
2个回答
|
|
void display_num(uchar adder,uchar num)//在第三行的左半屏写0-9数字
{ uchar i; write_lcom(0xbc); write_lcom(0x40+(adder-1)*8); for(i=num*16;i<8+num*16;i++) { write_ldate(~tablenum[i]); } write_lcom(0xbd); write_lcom(0x40+(adder-1)*8); for(i=num*16;i<8+num*16;i++) { write_ldate(~tablenum[i+8]); } } void display_date(uchar ye,uchar lie, uchar code table[])//在液晶的第ye页第lie列显示table[]所代表的字符 { uchar i ; if(lie<5)//在左半屏显示 { write_lcom(0xb8+(ye-1)*2); write_lcom(0x40+(lie-1)*16); for(i=0;i<16;i++) { write_ldate(~table[i]); } write_lcom(0xb9+(ye-1)*2); write_lcom(0x40+(lie-1)*16); for(i=0;i<16;i++) { write_ldate(~table[i+16]); } } if(lie>4)//在右半屏显示 { write_rcom(0xb8+(ye-1)*2); write_rcom(0x40+(lie-5)*16); for(i=0;i<16;i++) { write_rdate(~table[i]); } write_rcom(0xb9+(ye-1)*2); write_rcom(0x40+(lie-5)*16); for(i=0;i<16;i++) { write_rdate(~table[i+16]); } } } //在液晶的第ye行第lie列显示字符table前后留有半空格方便字符的居中 void display_ban(uchar ye,uchar lie, uchar code table[]) { uchar i ; if(lie<4)//左半屏显示 { write_lcom(0xb8+(ye-1)*2); write_lcom(0x40+(lie)*16-8); for(i=0;i<16;i++) { write_ldate(~table[i]); } write_lcom(0xb9+(ye-1)*2); write_lcom(0x40+lie*16-8); for(i=0;i<16;i++) { write_ldate(~table[i+16]); } } if(lie>4)//右半屏显示 { write_rcom(0xb8+(ye-1)*2); write_rcom(0x40+(lie-4)*16-8); for(i=0;i<16;i++) { write_rdate(~table[i]); } write_rcom(0xb9+(ye-1)*2); write_rcom(0x40+(lie-4)*16-8); for(i=0;i<16;i++) { write_rdate(~table[i+16]); } } if(lie==4) { write_lcom(0xb8+(ye-1)*2); write_lcom(0x40+(lie)*16-8); for(i=0;i<8;i++) { write_ldate(~table[i]); } write_lcom(0xb9+(ye-1)*2); write_lcom(0x40+lie*16-8); for(i=0;i<8;i++) { write_ldate(~table[i+16]); } write_rcom(0xb8+(ye-1)*2); write_rcom(0x40); for(i=0;i<8;i++) { write_rdate(~table[i+8]); } write_rcom(0xb9+(ye-1)*2); write_rcom(0x40); for(i=0;i<8;i++) { write_rdate(~table[i+16+8]); } } } |
|
|
|
那位好心的,教教我。。新手,,赶着用,
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
5437 浏览 3 评论
6738 浏览 1 评论
6999 浏览 0 评论
Protues中自己封装的芯片元件无Program File、Clock Frequency选项怎么解决,求求大神了!
8775 浏览 1 评论
基于51单片机的车辆倒车雷达报警系统,HC-SR04超声波测距,全套资料
1255 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-11 22:34 , Processed in 0.628724 second(s), Total 80, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号