《8×8LED点阵屏仿电梯数字滚动显示8页》由会员分享,可在线阅读,更多相关《8×8LED点阵屏仿电梯数字滚动显示8页(8页珍藏版)》请在金锄头文库上搜索。
1、88LED点阵屏仿电梯数字滚动显示软件设计原理图 仿真图 PCB图88LED点阵屏仿电梯数字滚动显示程序设计程序设计#include #include #define uchar unsigned char#define uint unsigned intuchar code Table_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
2、,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,;uchar Num_Index = 1,wei = 0,floor,i,mark,t;
3、void Delay()uint x;for( x = 0 ; x wei) + (Table_OF_Digits(Num_Index - 1 )*8 +temp (8-wei) ;else P0 = (Table_OF_DigitsNum_Index *8 +temp (8-wei) ; void Control_Move()int temp1,temp2;if(Num_Index floor)mark = 1;elsemark = 0;for( temp2 = 0 ;temp2 30 ; temp2 + )for ( temp1 = 0 ;temp1 8 ; temp1 +)LED_Scr
4、een_Display(temp1);if( +wei = 8 )wei =0;if( mark )if( (Num_Index -) = floor)P1 = 0xFF; else P2 = 0xFF;elseif( + Num_Index = floor)P1 = 0xFF;void ProcessKey()switch(P1)case 0xFE : P1 = 0xFE ; floor = 5;if(Num_Index = floor)P1 = 0xFF;else Control_Move();break;case 0xFD : P1 = 0xFD ; floor = 4;if(Num_I
5、ndex = floor)P1 = 0xFF;else Control_Move();break;case 0xFB : P1 = 0xFB ; floor = 3;if(Num_Index = floor)P1 = 0xFF;else Control_Move();break;case 0xF7 : P1 = 0xF7 ; floor = 2;if(Num_Index = floor)P1 = 0xFF;else Control_Move();break;case 0xEF : P1 = 0xEF ; floor = 1;if(Num_Index = floor)P1 = 0xFF;else Control_Move();break;default : break;void main()t = 0x7F;while(1)if(P1 != 0xFF)i = 0;t = 0x7F;ProcessKey();elseLED_Init();