单片机控制的led点阵显示毕业设计(编辑修改稿)内容摘要:

码 汉字的机内码是指在计算机中表示一个汉字的编码。 机内码与区位码稍有区别。 如上所述,汉字区位 码的区码和位码的取值均在 1~94 之间,如直接用区位码作为机内码,就会与基本 ASCII 码混淆。 为了避免机内码与基本 ASCII 码的冲突,需要避开基本 ASCII 码中的控制码 (00H~1FH),还需与基本 ASCII 码中的字符相区别。 为了实现这两点,可以先在区码和位码分别加上 20H,在此基础上再加80H(此处“ H”表示前两位数字为十六进制数 )。 我们可以通过这个软件将我们所要的使用的“机械电子”这四个字的代码给得出来,方便我们进行 C语言编程。 程序编写 以下是 8*8点阵 LED字符显示器完整的 C程序清单: include define char unsigned char define int unsigned int /***********机械电子 代码 ********/ char key,keytmp。 char code distab[40]= { /* 文字 : 机 */ 13 /* 宋体 12。 此字体下对应的点阵为:宽 x高 =16x16 */ 0x10,0x00,0x11,0xF0,0x11,0x10,0x11,0x10,0xFD,0x10,0x11,0x10,0x31,0x10,0x39,0x10, 0x55,0x10,0x55,0x10,0x91,0x10,0x11,0x12,0x11,0x12,0x12,0x12,0x12,0x0E,0x14,0x00 /* 文字 : 械 */ /* 宋体 12。 此字体下对应的点阵为:宽 x高 =16x16 */ 0x10,0x10,0x10,0x14,0x10,0x12,0x10,0x10,0xFB,0xFE,0x10,0x10,0x31,0x50,0x39,0x54, 0x57,0xF4,0x51,0x54,0x91,0x54,0x11,0x48,0x12,0x4A,0x12,0x5A,0x14,0x26,0x10,0x42 /* 文字 : 电 */ /* 宋体 12。 此字体下对应的点阵为:宽 x高 =16x16 */ 0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8, 0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x0A,0x01,0x02,0x01,0x02,0x00,0xFE /* 文字 : 子 */ /* 宋体 12。 此字体下对应的点阵为:宽 x高 =16x16 */ 0x00,0x00,0x7F,0xF8,0x00,0x10,0x00,0x20,0x00,0x40,0x01,0x80,0x01,0x00,0xFF,0xFE, 14 0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00}。 /***********绕行跑马灯代码 ********/ char code distac[512]= {0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//*****1****// 0x7f,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,//*****2****// 0x7f,0x7f,0x7f,0xff,0xff,0xff,0xff,0xff,//*****3****// 0x7f,0x7f,0x7f,0x7f,0xff,0xff,0xff,0xff,//*****4****// 0x7f,0x7f,0x7f,0x7f,0x7f,0xff,0xff,0xff,//*****5****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0xff,0xff,//*****6****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0xff,//*****7****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,//*****8****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x3f,//*****9****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x1f,//*****10****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x0f,//*****11****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x07,//*****12****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x03,//*****13****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x01,//*****14****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x00,//*****15****// 0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x00,//*****16****// 15 0x7f,0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x00,//*****17****// 0x7f,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x00,//*****18****// 0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x00,//*****19****// 0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****20****// 0x7f,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****21****// 0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****22****// 0x7c,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****23****// 0x78,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****24****// 0x70,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****25***// 0x60,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****26****// 0x40,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****27****// 0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****28****// 0x00,0x3e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,//*****29****// 0x00,0x3e,0x3e,0x7e,0x7e,0x7e,0x7e,0x00,//*****30****// 0x00,0x3e,0x3e,0x3e,0x7e,0x7e,0x7e,0x00,//****31****// 0x00,0x3e,0x3e,0x3e,0x3e,0x7e,0x7e,0x00,//*****32****// 0x00,0x3e,0x3e,0x3e,0x3e,0x3e,0x7e,0x00,//*****33****// 0x00,0x3e,0x3e,0x3e,0x3e,0x3e,0x3e,0x00,//*****34****// 0x00,0x3e,0x3e,0x3e,0x3e,0x3e,0x1e,0x00,//*****35****// 16 0x00,0x3e,0x3e,0x3e,0x3e,0x3e,0x0e,0x00,//*****36****// 0x00,0x3e,0x3e,0x3e,0x3e,0x3e,0x06,0x00,//*****37****// 0x00,0x3e,0x3e,0x3e,0x3e,0x3e,0x02,0x00,//*****38****// 0x00,0x3e,0x3e,0x3e,0x3e,0x3e,0x00,0x00,//*****39****// 0x00,0x3e,0x3e,0x3e,0x3e,0x3c,0x00,0x00,//*****40****// 0x00,0x3e,0x3e,0x3e,0x3c,0x3c,0x00,0x00,//*****41****// 0x00,0x3e,0x3e,0x3c,0x3c,0x3c,0x00,0x00,//*****42****// 0x00,0x3e,0x3c,0x3c,0x3c,0x3c,0x00,0x00,//*****43****// 0x00,0x3c,0x3c,0x3c,0x3c,0x3c,0x00,0x00,//*****44****// 0x00,0x38,0x3c,0x3c,0x3c,0x3c,0x00,0x00,//*****45****// 0x00,0x30,0x3c,0x3c,0x3c,0x3c,0x00,0x00,//*****46****// 0x00,0x20,0x3c,0x3c,0x3c,0x3c,0x00,0x00,//*****47****// 0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x00,0x00,//*****48****// 0x00,0x00,0x1c,0x3c,0x3c,0x3c,0x00,0x00,//*****49****// 0x00,0x00,0x1c,0x1c,0x3c,0x3c,0x00,0x00,//*****50****// 0x00,0x00,0x1c,0x1c,0x1c,0x3c,0x00,0x00,//*****51****// 0x00,0x00,0x1c,0x1c,0x1c,0x1c,0x00,0x00,//*****52****// 0x00,0x00,0x1c,0x1c,0x1c,0x0c,0x00,0x00,//*****53****// 0x00,0x00,0x1c,0x1c,0x1c,0x04,0x00,0x00,//*****54****// 17 0x00,0x00,0x1c,0x1c,0x1c,0x00,0x00,0x00,//*****55****// 0x00,0x00,0x1c,0x1c,0x18,0x00,0x00,0x00,//*****56****// 0x00,0x00,0x1c,0x18,0x18,0x00,0x00,0x00,//*****57****// 0x00,0x00,0x18,0x18,0x18,0x00,0x00,0x00,//*****58****// 0x00,0x00,0x10,0x18,0x18,0x00,0x00,0x00,//*****59****// 0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,//*****60****// 0x00,0x00,0x00,0x08,0x18,0x00,0x00,0x00,//*****61****// 0x00,0x00,0x00,0x08,0x08,0x00,0x00,0x00,//*****62****// 0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,//*****63***// 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//*****64***// }。 /***********列扫描控制 ********/ char code scan_con[8]= {0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}。 /***********按键扫描控制 ********/ void keyscan() {key=(~P1)amp。 0x0f。 if(key!=0) { while(((~P1)amp。 0x0f)!=0)。 18 keytmp=key。 } } /***********控制延时程序 ********/ delaylms(int t) { int i,j。 for(i=0。 it。 i++) for(j=0。 j120。 j++) keyscan()。 } //*****功能程序 *******// //******逐字显示程序 ******// fun0() {int m,n,h。 for(h=0。 h32。 h=h+8) {for(n=0。 n80。 n++) {for(m=0。 m8。 m++) {P0=distab[m+h]。 P2=scan_con[m]。 delaylms(1)。 }}}} //*********向上滚动显示程序 *********// fun1() 19 {int m,n,h。 for(h=0。 h32。 h=h+1) {fo。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。