您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 酒店餐饮 > 8×8LED点阵屏仿电梯数字滚动显示
8×8LED点阵屏仿电梯数字滚动显示软件设计原理图仿真图PCB图8×8LED点阵屏仿电梯数字滚动显示程序设计程序设计#includereg52.h#includeintrins.h#defineucharunsignedchar#defineuintunsignedintucharcodeTable_OF_Digits[]={0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x00,0x00,0x00,0x00,0x21,0x7f,0x01,0x00,0x00,0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x00,0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x00,0x00,0x0c,0x14,0x24,0x7f,0x04,0x00,0x00,0x00,0x72,0x51,0x51,0x51,0x4e,0x00,0x00,0x00,0x3e,0x49,0x49,0x49,0x26,0x00,0x00,0x00,0x40,0x40,0x40,0x4f,0x70,0x00,0x00,0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00,0x00,0x32,0x49,0x49,0x49,0x3e,0x00,0x00,};ucharNum_Index=1,wei=0,floor,i,mark,t;voidDelay(){uintx;for(x=0;x110;x++);}voidLED_Init(){Delay();t=_cror_(t,1);P3=t;P0=Table_OF_Digits[Num_Index*8+i];if(++i==8){i=0;}}voidLED_Screen_Display(inttemp){Delay();t=_cror_(t,1);P3=t;if(mark)P0=(Table_OF_Digits[Num_Index*8+temp]wei)+(Table_OF_Digits[(Num_Index-1)*8+temp](8-wei));elseP0=(Table_OF_Digits[Num_Index*8+temp]wei)+(Table_OF_Digits[(Num_Index+1)*8+temp](8-wei));}voidControl_Move(){inttemp1,temp2;if(Num_Indexfloor)mark=1;elsemark=0;for(temp2=0;temp230;temp2++){for(temp1=0;temp18;temp1++){LED_Screen_Display(temp1);}}if(++wei==8){wei=0;if(mark)if((Num_Index--)==floor)P1=0xFF;elseP2=0xFF;elseif(++Num_Index==floor)P1=0xFF;}}voidProcessKey(){switch(P1){case0xFE:P1=0xFE;floor=5;if(Num_Index==floor)P1=0xFF;elseControl_Move();break;case0xFD:P1=0xFD;floor=4;if(Num_Index==floor)P1=0xFF;elseControl_Move();break;case0xFB:P1=0xFB;floor=3;if(Num_Index==floor)P1=0xFF;elseControl_Move();break;case0xF7:P1=0xF7;floor=2;if(Num_Index==floor)P1=0xFF;elseControl_Move();break;case0xEF:P1=0xEF;floor=1;if(Num_Index==floor)P1=0xFF;elseControl_Move();break;default:break;}}voidmain(){t=0x7F;while(1){if(P1!=0xFF){i=0;t=0x7F;ProcessKey();}else{LED_Init();}}}
本文标题:8×8LED点阵屏仿电梯数字滚动显示
链接地址:https://www.777doc.com/doc-6502586 .html