- /***********************************************************
- 用数组的方式正常显示四个字加移动显示
- 正常向右移动显示:苏义江欢迎你的光临,恭喜发财 招财进宝
- ******************************************************/
- #include
- #include
- #define NOP() _nop_()
- #define uchar unsigned char
- #define uint unsigned int
- ***it A1 =P2^0;
- ***it B1 =P2^1;
- ***it C1 =P2^2;
- ***it OE=P2^3; //74HC138的使能
- /****it a=P2^0;
- ***it b=P2^1;
- ***it c=P2^2;
- ***it d=P2^3; */
- ***it DS_sr=P1^2;
- ***it DS_sr1=P1^3;
- ***it SH_yw=P1^0;
- ***it ST_sc=P1^1;
- ***it key=P1^4;
- uchar code Tab2[]={//仿宋。阳码,逆向,逐行扫描
- //恭(0) 喜(1) 发(2) 财(3)
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0xDF,0xFD,0xDF,0xFD,0x03,0xC0,0xDF,0xFD,0xDF,0xFD,0x01,0x80,0xDF,0xFD,0xEF,0xFB,
- 0x77,0xF7,0x7B,0xEF,0x7C,0x9F,0x77,0xF5,0x77,0xEB,0x7B,0xEB,0x5F,0xFF,0xBF,0xFF,/*"恭",0*/
- 0x7F,0xFF,0x01,0xC0,0x7F,0xFF,0x03,0xE0,0xFF,0xFF,0x07,0xF0,0xF7,0xF7,0x07,0xF0,
- 0xDF,0xFD,0x00,0x80,0xFF,0xFF,0x07,0xF0,0xF7,0xF7,0xF7,0xF7,0x07,0xF0,0xFF,0xFF,/*"喜",1*/
- 0xBF,0xFF,0xBB,0xFD,0xBB,0xF3,0xBB,0xF7,0x01,0x80,0xDB,0xFF,0xDF,0xFF,0x1F,0xF8,
- 0xCF,0xFB,0xAF,0xFB,0xAF,0xFB,0x77,0xFD,0xFB,0xFE,0x7D,0xF9,0x9E,0xC7,0xE7,0xEF,/*"发",2*/
- 0xFF,0xEF,0x81,0xEF,0xBD,0xEF,0xAD,0xEF,0xAD,0x80,0xAD,0xE7,0xAD,0xE7,0xAD,0xEB,
- 0xAD,0xEB,0xAD,0xED,0xEF,0xED,0xD7,0xEE,0xB7,0xEF,0x3B,0xEF,0xBD,0xEB,0xFE,0xF7,/*"财",3*/
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- };
- uchar code zimo[][32]= {//黑体 恭喜发财 阳码 逆向 逐行
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {0xDF,0xFD,0xDF,0xFD,0x00,0x80,0xDF,0xFD,0x5F,0xFD,0x7F,0xFF,0x03,0xF0,0x7F,0xF7,
- 0x37,0xF7,0xB7,0xD7,0x93,0xB7,0xDB,0xB7,0xEF,0xF7,0xF7,0xF6,0xF9,0xF9,0xFF,0xFF},/*"苏",0*/
- {0xFF,0xFF,0xDF,0xFB,0xBB,0xF3,0x7B,0xFB,0x77,0xFB,0xF7,0xFD,0xEF,0xFD,0xDF,0xFE,
- 0xBF,0xFE,0x7F,0xFF,0xBF,0xFE,0xDF,0xFD,0xEF,0xF3,0xF3,0x8F,0xFC,0xDF,0xFF,0xFF},/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0x80,0xF3,0xFF,0x33,0xE0,0xF5,0xFF,0x36,0xE0,
- 0xF7,0xFF,0x37,0xE0,0xB7,0xEF,0xB7,0xEF,0xB7,0xEF,0x37,0xE0,0xB7,0xEF,0xFF,0xFF},/*"信",1*/
- {0x7F,0xFF,0x7F,0xFE,0xBF,0xFF,0x07,0xE0,0xF7,0xEF,0xF7,0xEF,0x07,0xE0,0xF7,0xEF,
- 0xF7,0xEF,0xF7,0xEF,0x07,0xE0,0xF7,0xEF,0xF7,0xEF,0xF7,0xEF,0x07,0xE0,0xF7,0xEF},/*"自",2*/
- {0xFF,0xFF,0x03,0xF0,0xFF,0xF7,0xFF,0xF7,0xFF,0xF7,0x03,0xF0,0xFB,0xF7,0xFB,0xFF,
- 0xFB,0xFF,0xFB,0xFF,0xFB,0xFF,0xFB,0xDF,0xFB,0xDF,0xFB,0x9F,0x07,0xC0,0xFF,0xFF},/*"己",3*/
- {0x93,0xC4,0x21,0x89,0x41,0x82,0x00,0x00,0x00,0x00,0x3C,0x3C,0x00,0x00,0x18,0x18,
- 0x18,0x18,0x00,0x00,0x81,0x81,0x01,0x80,0x23,0xC4,0xC7,0xE3,0x0F,0xF0,0x1F,0xF8},/*"未命名文件",0*/
- {0x93,0xC4,0x21,0x89,0x41,0x82,0x00,0x00,0x00,0x00,0x3C,0x3C,0x00,0x00,0x18,0x18,
- 0x18,0x18,0x00,0x00,0x81,0x81,0x01,0x80,0x23,0xC4,0xC7,0xE3,0x0F,0xF0,0x1F,0xF8},/*"未命名文件",0*/
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },{
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },{
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- },
- };
- uchar code sw[]={0xf8,0xf9,0xfa,0xfb,0xfd,0xfe,0xff};
- /*void yiwei(uchar DATA)
- {
- uchar k;
- for(k=0;k<8;k++)
- {
- SHURU=DATA&0x01;
- SH_yw=0;
- SH_yw=1;
- DATA=DATA>>1;
- }
- } */
- void hangsao(uchar num)
- {
- switch(num)
- {
- case 0:C1=0;B1=0;A1=0;break;
- case 1:C1=0;B1=0;A1=1;break;
- case 2:C1=0;B1=1;A1=0;break;
- case 3:C1=0;B1=1;A1=1;break;
- case 4:C1=1;B1=0;A1=0;break;
- case 5:C1=1;B1=0;A1=1;break;
- case 6:C1=1;B1=1;A1=0;break;
- case 7:C1=1;B1=1;A1=1;break;
- default:break;
- }
- }
- //向595写进上半屏第一行和下半屏第十七行
- void Yiwei(uchar Data,uchar Data1)
- {
- uchar i;
- for(i = 0; i < 8; i++)
- {
- DS_sr =Data & 0x01;//上半屏第一个字节
- DS_sr1=Data1 & 0x01;//下半屏第十七个字节
- SH_yw= 0;
- NOP();NOP();NOP();
- SH_yw= 1;
- Data =Data >> 1;
- Data1=Data1>> 1;
- }
- }
- void delay(uint n)
- {
- while(n--);
- }
- void xiaoyin()
- { uchar i;
- for(i=0;i<8;i++)
- {
- Yiwei(0xff,0xff);
- }
- OE=0;
- ST_sc=0;
- ST_sc=1;
- OE=1;
- }
- void main()
- {
- uchar i,j,a,q;
- ST_sc=0;SH_yw= 0;
- OE=0;
- DS_sr =0;
- DS_sr1=0;
- xiaoyin();
- while(1)
- {
- /*4个字静态显示
- for(i=0;i<8;i++)//因为是8/1扫 就扫描8行
- {
- for(j=0;j<4;j++)
- {
- Yiwei(zimo[j][2*i+0],zimo[j][2*i+16]);
- Yiwei(zimo[j][2*i+1],zimo[j][2*i+1]);
- }
- OE=0;
- ST_sc=0;
- NOP();NOP();NOP();NOP();NOP();
- ST_sc=1;//上升沿启动锁存
- OE=1;
- hangsao(i);
- }
- */
- //移动显示(一)
- for(a=0;a<30;a++) //移动速度
- {
- for(i=0;i<8;i++) ////因为是8/1扫 就扫描8行
- {
- for(j=8;j>0;j--) //一屏显示4个字移动1个字
- {
- Yiwei(zimo[j-1+q][2*i+0],zimo[j-1+q][2*i+16]);
- Yiwei(zimo[j-1+q][2*i+1],zimo[j-1+q][2*i+16+1]);
- }
- OE=0;
- ST_sc=0;
- ST_sc=1;//上升沿启动锁存
- OE=1;
- hangsao(i);
- delay(600);
- }
- xiaoyin();
- }
- delay(800);
- q++;
- if(q>50) //总的字模数减去4
- q=0;
- }
- }
|