资源描述:
《基于51单片机控制的LED点阵显示屏(c 语言).doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、基于51单片机控制的LED点阵显示屏(c语言)本点阵屏由单片机控制4块8x8点阵,显示一个16x16点阵的汉字,如下图所示。一个汉字循环显示的50次。这里采用的芯片有74LS254(增大单片机P0、P2的驱动能力)、行扫描由P1.0~P1.3经74LS154译码后产生标号为ROW0~ROW15的16控制行线。列数据由P0、P2分别提供高8位和低8位。这里的P0口做普通的IO口用。程序:#include#defineuintunsignedint#defineucharunsignedcharucharc
2、odetable[]={0x08,0x80,0x08,0x44,0x0F,0xFE,0x10,0x00,0x10,0x08,0x37,0xFC,0x50,0x00,0x90,0x08,0x17,0xFC,0x10,0x00,0x13,0xF8,0x12,0x08,0x12,0x08,0x12,0x08,0x13,0xF8,0x12,0x08,/*信*/0x02,0x00,0x04,0x10,0x1F,0xF8,0x10,0x10,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x
3、10,0x10,0x10,0x1F,0xF0,0x02,0x00,0x51,0x84,0x50,0x92,0x90,0x12,0xF,0xF0/*息*/};uinta,b,c,i,j,d;voiddelay(uintz){uintx,y;for(x=z;x>0;x--)for(y=110;y>0;y--);}voidxianshi(){for(j=0;j<50;j++){a=0;b=0;c=d;for(i=0;i<16;i++){a=b;//a=0;P1=a;b++;a=c;P0=table[a];c++;a=c;P2=t
4、able[a];c++;delay(1);P0=0;P2=0;}}}voidmain(){d=0;while(1){d=c;if(c==64){d=0;xianshi();}elsexianshi();}}