16*96LED点阵屏单片机课程设计的图:
单片机源程序如下:
- #include<reg51.h>
- typedef unsigned char uchar;
- typedef unsigned int uint;
- sbit E1=P3^4;
- sbit ST=P3^5;
- sbit SS=P3^6;
- unsigned char code mo[6][2][16]=
- {{{
- 0xF7,0xF7,0xF6,0xF6,0xF7,0xF7,0xF6,0xF6,0xF7,0x87,0xF0,0xF7,0xF7,0xF7,0xF7,0xF7},
- {0xEF,0x47,0xF0,0xF7,0xF7,0x40,0xF7,0xE3,0xD3,0xF5,0x35,0xF6,0xF7,0xF7,0xF7,0xF7}},
- {{0xFF,0x80,0xFB,0xFB,0xFB,0xC0,0xDB,0xDB,0xDB,0xDB,0xDB,0xD3,0xEB,0xFB,0xFB,0xFB},
- {0xEF,0x2F,0xED,0xED,0xED,0x6D,0x6D,0x6D,0x6D,0x6D,0x6D,0x6F,0x77,0xF7,0xFB,0xFD}},
- {{0xFE,0xFE,0xFE,0xC0,0xDF,0xEF,0xFD,0xFD,0xFD,0xFA,0xFA,0xF7,0xF7,0xEF,0xDF,0xBF},
- {0xFF,0xFF,0xC0,0xDF,0x5F,0x6D,0xAB,0xD7,0xF7,0xEB,0xDB,0x5D,0x7E,0xBF,0xDF,0xEF}},
- {{0xFF,0xFE,0xC3,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xD2,0xEB,0xFB,0xFB,0xFB,0x80,0xFF},
- {0xFF,0xFB,0x37,0xB7,0xBF,0xBF,0xB0,0xB7,0xB7,0xB7,0x37,0xB7,0xF7,0xEB,0x1D,0xFF}},
- {{0xFE,0xFE,0xFE,0x80,0xBF,0xDF,0xFB,0xFB,0xEB,0xDB,0xDB,0xBB,0xBB,0xFB,0xFA,0xFD},
- {0xEF,0xEF,0xEF,0x77,0x77,0xB3,0xD3,0xF5,0x76,0x77,0xB7,0xB7,0xD7,0xF7,0xF7,0xF7}},
- {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},
- {0xFF,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0xFF,0xFF,0xF7,0xF7,0xFF,0xFF}}};
- void yiwei(int i,int j,int k)
- {
- SBUF=mo[i][j][k];
- while(~TI){};
- TI=0;
- }
- void main() /*主函数*/
- { int i=0,j=0,k=0,n,u;
- uchar l=0;
- SM0=0;
- SM1=0;
- ST=0;
- TI=0;
- yiwei(i,j,k);
- n=0;
- while(1){
- {for(i=0;i<6-0;i++)
- {yiwei(i,0,k);
- yiwei(i,1,k);
- }
- i=0;
- k++;
- if(k>15)
- k=0;
- P2=n;
- E1=0;
- ST=1;
- for(u=0;u<300;u++){}
-
- n++;
- if(n>16)
- n=0;
- E1=1;
- ST=0;
- }
-
- }
-
- }
复制代码
所有资料51hei提供下载:
xvshuo.rar
(41.23 KB, 下载次数: 77)
|