这样改一下:
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
#define out0 P0
#define out2 P2
#define out1 P1
void delay(uint j) //延时函数
{
uchar i=250;
for(;j>0;j--)
{
while(--i);
i=100;
}
}
uchar code string[]=
{
//汉字“”的16*16点阵的列码
0xFF,0xFF,0xFF,0xFF,0x80,0x07,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xF6,0xFF,0xFA,0xFF,0xFC,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,
//汉字“”的16*16点阵的列码
0xFF,0xFF,0xFB,0xFF,0xF7,0xFF,0xE0,0x80,0xDB,0xF7,0xFB,0xF7,0xE0,0xF7,0xFB,0xF7,
0xFB,0xC1,0xE0,0xF7,0xFB,0xF5,0xFA,0xF6,0xF9,0xF7,0xFB,0x80,0xFF,0xFF,0xFF,0xFF,
//汉字“”的16*16点阵的列码
0xFF,0xFF,0xB8,0x60,0xDB,0x77,0xE8,0x60,0xFB,0x6E,0xF8,0x6E,0xBD,0xEA,0xDE,0xEA,
0xE8,0x2A,0xFC,0x6A,0xFD,0x6A,0xEC,0x7B,0xDA,0xBB,0xB4,0xD5,0x7E,0xEE,0xFF,0xFF
};
void main()
{
uchar i,j,n;
while(1)
{
for(j=0;j<3;j++)
{
for(n=0;n<40;n++)
{
for(i=0;i<16;i++)
{
out1=i%16;
out0=string[i*2+j*32];
out2=string[i*2+1+j*32];
delay(4);
out0=0xff;
out2=0xff;
}
}
}
}
} |