8*8点阵显示简单汉字 有朋友说,一块8*8点阵无法显示汉字,要4块点阵组合才能显示汉字。对于显示所有常用汉字来说,也许他是对的。但对于笔画较多的汉字,4块8*8点阵的显示效果也未必好吧?我觉得对于笔画简单的汉字,一块点阵就够了! 接线如下: file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image004.jpg file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image006.jpg 显示汉字:人口手刀弓车上下左 8乘8点阵显示简单汉字—在线播放—优酷网,视频高清在线观看 file:///C:/Users/ADMINI~1/AppData/Local/Temp/msohtmlclip1/01/clip_image008.gifhttp://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_shang0x01,0x01,0x01,0xFF,0x21,0x21,0x21,0x01 //上 #define data_ascii_xia 0x80,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<<j; 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<<j; } } 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)); } } } } 话说回来,我真是很佩服当年制作汉字字库的前辈们!
|