点阵礼花程序 就是看着好玩- #include<reg52.h>
- #include<intrins.h>
- #define uint unsigned int
- #define uchar unsigned char
- unsigned char code tabP0[6][8]={{0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00},{0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00},{0x00,0x00,0x10,0x38,0x38,0x10,0x00,0x00},{0x00,0x00,0x38,0x7C,0x7C,0x38,0x00,0x00},{0x00,0x38,0x7C,0x7C,0x7C,0x7C,0x38,0x00},{0x3C,0x7E,0xFF,0xFF,0xFF,0xFF,0x7E,0x3C}};
- unsigned char code tabP2[]={0x7F,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0xFE};
- void delay(uint z)
- {
- uchar x,y;
- for(x=z;x>0;x--)
- for(y=110;y>0;y--);
- }
- void main()
- {
- int i,j,k;
- while(1)
- {
- for(j=0;j<6;j++)
- {
- for(k=0;k<25;k++)
- {
- for(i=0;i<8;i++)
- {
- P0=0;
- P2=tabP2;
- P0=tabP0[j];
- delay(2);
- }
- }
- }
- }
- }
复制代码 |