51单片机 16x16点阵显示汉字左移proteus仿真原理图:
16x16点阵单片机左移源程序:
- #include<reg52.h>
- #define uchar unsigned char
- #define uint unsigned int
- uchar m,n,i,b;
- sbit hang0=P0^6;
- sbit hang1=P0^7;
- uchar code lie[16]={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
- uchar code hang[6][32]={{0xFF,0xBF,0xFD,0xBF,0x7D,0xBF,0x7D,0xBF,0x7D,0xBF,0x7D,0xBF,0x7D,0xBF,0x01,0x80,0x7D,0xBF,0x7D,0xBF,0x7D,0xBF,0x7D,0xBF,0x7D,0xBF,0xFD,0xBF,0xFF,0xBF,0xFF,0xFF},/*"王",0*/
- {0xBF,0x7F,0xBD,0xBF,0xBB,0xDF,0xA7,0xE7,0x3F,0xF8,0xBF,0xFF,0x80,0xFF,0xBF,0xFF,0x3F,0xC0,0xAF,0xBF,0xB7,0xBF,0xB9,0xBF,0xBF,0xBF,0xBF,0x87,0xFF,0xFF,0xFF,0xFF},/*"光",1*/
- {0xEF,0xFD,0xF3,0xFD,0xDB,0xFD,0xDB,0xFD,0xDB,0xFD,0xDB,0xBD,0xDA,0x7D,0x19,0x80,0xDB,0xFD,0xDB,0xFD,0xDB,0xFD,0xDB,0xFD,0xDB,0xFD,0xEB,0xFD,0xF3,0xFD,0xFF,0xFF},/*"宇",2*/
- {0xFF,0x7E,0xFF,0xBE,0xFF,0xDE,0x80,0xE2,0xB6,0xDE,0xB6,0xBE,0xB6,0x7E,0xB6,0x00,0xB6,0x76,0xB6,0x76,0xB6,0x76,0x80,0x76,0xFF,0x76,0xFF,0x7E,0xFF,0x7E,0xFF,0xFF},/*"是",3*/
- {0xFF,0x7F,0xFF,0x9F,0x07,0xE0,0xF7,0xFF,0xB7,0xC1,0xB7,0xED,0xB7,0xED,0xB7,0x41,0xF7,0xBF,0x00,0xDE,0xF7,0xE9,0xF6,0xE7,0xF5,0xD9,0x37,0xBE,0xF7,0x07,0xFF,0xFF},/*"咸",4*/
- {0xBF,0xBF,0xDF,0xBF,0x0F,0xB0,0xD7,0xB6,0xDB,0xB6,0xD8,0xB6,0xDB,0xB6,0x1B,0xB0,0xDB,0xB6,0xCB,0xB6,0xD3,0xB6,0xDF,0xB6,0x1F,0xB0,0xFF,0xBF,0xFF,0xBF,0xFF,0xFF},/*"鱼",5*/
- };
- delayms(uint tms)
- {
- uint x,y;
- for(x=tms;x>0;x--)
- for(y=110;y>0;y--);
- }
- main()
- {
- while(1)
- {
- for(m=0;m<6;m++)
- for(b=0;b<16;b++)
- for(n=0;n<20;n++)
- for(i=0;i<16;i++)
- {
- hang0=1;
- P2=lie[i];
- P1=hang[m][2*(i+b)];
- hang0=0;
- P1=0xff;
- hang1=1;
- P2=lie[i];
- P1=hang[m][2*(i+b)+1];
- hang1=0;
- delayms(1);
- P1=0xff;
-
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
下载:
16X16.zip
(62.94 KB, 下载次数: 153)
|