完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
有朋友说,一块8*8点阵无法显示汉字,要4块点阵组合才能显示汉字。对于显示所有常用汉字来说,也许他是对的。但对于笔画较多的汉字,4块8*8点阵的显示效果也未必好吧?我觉得对于笔画简单的汉字,一块点阵就够了! 接线如下: 显示汉字:人口手刀弓车上下左 8乘8点阵显示简单汉字—在线播放—优酷网,视频高清在线观看 http://v.youku.com/v_show/id_XMjk0MDY0MjgwNA==.html?spm=a2h0k.8191407.0.0&from=s1.8-1-1.2 源代码: #define display_array_size 8 #define data_null 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00 #define data_ascii_ren0x01,0x02,0x04,0x08,0xF8,0x04,0x02,0x01 //人 #define data_ascii_kou0x7E,0x42,0x42,0x42,0x42,0x42,0x7E,0x00 //口 #define data_ascii_shou0x08,0x28,0x6A,0x69,0xFF,0xA8,0x28,0x08 //手 #define data_ascii_dao0x42,0x44,0x48,0x50,0x60,0x44,0x42,0x7F //刀 #define data_ascii_gong0x80,0xB8,0xA8,0xA8,0xA9,0xA9,0xA9,0xEF //弓 #define data_ascii_che0x0A,0x4A,0x5A,0x6A,0xFF,0x4A,0x4A,0x0A //车 #define data_ascii_shang 0x01,0x01,0x01,0xFF,0x21,0x21,0x21,0x01//上 #define data_ascii_xia0x80,0x80,0x80,0xFF,0xC0,0xA0,0x90,0x80 //下 #define data_ascii_zuo0x49,0x51,0x69,0x49,0xCF,0x49,0x49,0x41 //左 byte data_ascii[][display_array_size] = { data_null, data_ascii_ren, data_ascii_kou, data_ascii_shou, data_ascii_dao, data_ascii_gong, data_ascii_che, data_ascii_shang, data_ascii_xia, data_ascii_zuo, }; //the pin to control ROW const int row1 = 2; // the number of therow pin 24 const int row2 = 3; // the number of therow pin 23 const int row3 = 4; // the number of therow pin 22 const int row4 = 5; // the number of therow pin 21 const int row5 = 17; // the number of therow pin 4 const int row6 = 16; // the number of therow pin 3 const int row7 = 15; // the number of therow pin 2 const int row8 = 14; // the number of therow pin 1 //the pin to control COl const int col1 = 6; // the number of thecol pin 20 const int col2 = 7; // the number of thecol pin 19 const int col3 = 8; // the number of thecol pin 18 const int col4 = 9; // the number of thecol pin 17 const int col5 = 10; // the number of thecol pin 16 const int col6 = 11; // the number of thecol pin 15 const int col7 = 12; // the number of thecol pin 14 const int col8 = 13; // the number of thecol pin 13 void displayNum(byte rowNum,int colNum) { int j; byte temp = rowNum; for(j=2;j<6;j++) { digitalWrite(j, LOW); } digitalWrite(row5, LOW); digitalWrite(row6, LOW); digitalWrite(row7, LOW); digitalWrite(row8, LOW); for(j=6;j<14;j++) { digitalWrite(j, HIGH); } switch(colNum) { case 1: digitalWrite(col1, LOW); break; case 2: digitalWrite(col2, LOW); break; case 3: digitalWrite(col3, LOW); break; case 4: digitalWrite(col4, LOW); break; case 5: digitalWrite(col5, LOW); break; case 6: digitalWrite(col6, LOW); break; case 7: digitalWrite(col7, LOW); break; case 8: digitalWrite(col8, LOW); break; default: break; } for(j = 1 ;j < 9; j++) { temp = (0x80)&(temp) ; if(temp==0) { temp = rowNum<
continue; } switch(j) { case 1: digitalWrite(row1, HIGH); break; case 2: digitalWrite(row2, HIGH); break; case 3: digitalWrite(row3, HIGH); break; case 4: digitalWrite(row4, HIGH); break; case 5: digitalWrite(row5, HIGH); break; case 6: digitalWrite(row6, HIGH); break; case 7: digitalWrite(row7, HIGH); break; case 8: digitalWrite(row8, HIGH); break; default: break; } temp = rowNum<
} } void setup(){ int i = 0 ; for(i=2;i<18;i++) { pinMode(i, OUTPUT); } for(i=2;i<18;i++) { digitalWrite(i, LOW); } } void loop(){ int t1; int l; int arrage; for(arrage=0;arrage<10;arrage++) { for(l=0;l<512;l++) { for(t1=0;t1<8;t1++) { displayNum(data_ascii[arrage][t1],(t1+1)); } } } } 话说回来,我真是很佩服当年制作汉字字库的前辈们!
|
|
相关推荐
2 个讨论
|
|
只有小组成员才能发言,加入小组>>
5545 浏览 0 评论
11821 浏览 9 评论
4900 浏览 1 评论
14154 浏览 0 评论
14429 浏览 0 评论
FRSE 2023 | 机器人与软件工程前沿国际会议诚征优秀稿件
3202浏览 0评论
哪位大哥有库卡KUKA.EtherNetIP MS(2.X版本)软件包?
4520浏览 0评论
如果设计一款桌面款的机器玩具,最吸引人的外观与功能要有哪些?
3382浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 16:29 , Processed in 0.783392 second(s), Total 47, Slave 38 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号