完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
这是LED显示汉字的一段程序。我自己用汉字字模提取后输入的在怎么搞也显示不正确,
不知道怎么能办好#include #include #define uchar unsigned char #define uint unsigned int uchar code k[][8]={ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//ÏÔʾµÄµÚÒ»¸ö×Ö {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},// {0x00,0x10,0x10,0x10,0x10,0xD0,0x30,0xFF}, {0x30,0xD0,0x10,0x10,0x10,0x10,0x00,0x00}, {0x10,0x08,0x04,0x02,0x09,0x08,0x08,0xFF}, {0x08,0x08,0x09,0x02,0x04,0x08,0x10,0x00}, {0x00,0x00,0x41,0x84,0x26,0x7E,0x14,0x44}, {0x04,0x44,0x04,0x44,0xF4,0x44,0x14,0xC4}, {0x15,0x44,0x16,0x54,0x14,0x48,0x10,0x40}, {0x10,0x40,0x28,0x46,0x47,0xFC,0x00,0x00},//Ó {0x01,0x00,0x21,0x08,0x11,0x0C,0x09,0x10}, {0x09,0x20,0x01,0x04,0xFF,0xFE,0x04,0x40}, {0x04,0x40,0x04,0x40,0x04,0x40,0x08,0x40}, {0x08,0x42,0x10,0x42,0x20,0x3E,0x40,0x00},//¹â {0x10,0x80,0x10,0x80,0x51,0x04,0x51,0xFE}, {0x52,0x00,0x54,0x80,0x58,0x60,0x50,0x24}, {0x57,0xFE,0x54,0x44,0x54,0x44,0x54,0x44}, {0x54,0x44,0x14,0x44,0x17,0xFC,0x14,0x04},//ÁÙ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},// }; void delay(uint t) { uint i; for (i=0;i } void in(uchar x,y)//ËÍÒ»ÏÔʾ×Ö { uchar a,i,j,t; //ËÍÒ»ÐÐ for (t=0;t<2;t++) { for (i=y-2;i { a=k[x]; for (j=0;j<8;j++) { P2_0=a & 0x80; P2_1=0; delay(2); P2_1=1; a<<=1; } } x=x+4; } } void yidong(uchar x,y,z) { uchar a,i; //Òƶ¯Ò»ÐÐ a=k[x+8][y-2]; for (i=0;i { P2_0=a & 0x80; P2_1=0; delay(2); P2_1=1; a<<=1; if (i==7) { a=k[x+8][y-1]; } } } void out()//Êä³öÒ»×Ö { P1=0xcf; P2_2=0; delay(2); P2_2=1; } void main() { uchar w=1,u,x,y,z,d,c=4,b,a=0xd8; do { y=y+2; in(x,y); yidong(x,y,z); out(); P1=a; if (++a==0xe8) { a=0xd8; } if (y==8) { y=0; if (++x==c) { x=d; } } if (++b==32) { b=0; if (++z==17) { u++; if (u==1)//¼Ó×ÖÐ޸Ĵ¦ {z=1;x=4;c=8;d=4;} if(u==2) {z=1;x=8;c=12;d=8;} if(u==3) {z=1;x=12;c=16;d=12;} if(u==4) {z=1;x=0;c=4;d=0;u=0;}//×îºóuÒª±ä0 } } }while(1); } |
|
相关推荐
3个回答
|
|
其中的四个字,后三个是能显示的 第一个是我自己改的,却怎么也改不好
|
|
|
|
你的取模时的方向什么的选择正确了么
|
|
|
|
天道酬勤,学习学习
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
4780 浏览 3 评论
6067 浏览 1 评论
6330 浏览 0 评论
Protues中自己封装的芯片元件无Program File、Clock Frequency选项怎么解决,求求大神了!
8080 浏览 1 评论
基于51单片机的车辆倒车雷达报警系统,HC-SR04超声波测距,全套资料
1235 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-29 00:41 , Processed in 0.549986 second(s), Total 82, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号