您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 酒店餐饮 > 点阵显示姓名C语言程序
#includereg51.h#includeintrins.hunsignedcharcodeFONT16x16[3][32]={{0x04,0x48,0x7F,0xFC,0x04,0x48,0x7F,0xF8,0x44,0x40,0x7F,0xFE,0x04,0x42,0x08,0x4A,0x3F,0xF4,0xD0,0x10,0x11,0x10,0x11,0x10,0x11,0x10,0x02,0xC0,0x0C,0x30,0x30,0x08},//费{0x00,0x08,0x3F,0xFC,0x20,0x08,0x3F,0xF8,0x20,0x08,0x3F,0xF8,0x01,0x00,0x21,0x08,0x3F,0xFC,0x21,0x00,0x41,0x10,0xBF,0xF8,0x01,0x00,0x01,0x04,0xFF,0xFE,0x00,0x00},//星{0xEF,0xDF,0xED,0xDF,0xED,0xDF,0xDD,0xDB,0xC0,0x01,0x9D,0x7B,0x5D,0xBB,0xDD,0xBB,0xD0,0x37,0xD7,0x57,0xD7,0x57,0xD7,0x6F,0xD7,0x57,0xD0,0x57,0xD7,0xB9,0xDF,0x7B}};//做sbitSDI=P2^1;sbitSRCLK=P2^0;sbitRCLK=P2^2;#defineLineCtrlP1voiddelay(unsignedintus){while(us--);}voidSendByte(unsignedchardat){unsignedchari;for(i=0;i8;i++){SRCLK=0;if(dat&0x80)SDI=1;elseSDI=0;SRCLK=1;dat=dat1;}}voidDisplay(unsignedchar*dat1,unsignedchar*dat2,unsignedchar*dat3){unsignedchari;for(i=0;i16;i++){SendByte(dat3[2*i+1]);SendByte(dat3[2*i]);SendByte(dat2[2*i+1]);SendByte(dat2[2*i]);SendByte(dat1[2*i+1]);SendByte(dat1[2*i]);RCLK=0;_nop_();_nop_();_nop_();_nop_();LineCtrl=i;RCLK=1;delay(100);}}voidmain(void){while(1)Display(FONT16x16[0],FONT16x16[1],FONT16x16[2]);}
本文标题:点阵显示姓名C语言程序
链接地址:https://www.777doc.com/doc-4669073 .html