- #include<reg51.h>
- #define uchar unsigned char
- #define unit unsighed int
- #define out0 P0
- #define out2 P2
- #define out2 P1
- void delay(unit j)
- {
- uchar i=250;
- for(;j>0;j--)
- {
- while(--i);
- i=100;
- }
- }
- uchar code string[]={
- //汉字“东”的16*16点阵的列码
- 0x00,0x08,0x88,0x48,0x28,0x18,0x0F,0xE8,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,
- 0x00,0x20,0x11,0x09,0x05,0x41,0x81,0x7F,0x01,0x01,0x05,0x09,0x11,0x20,0x00,0x00
- //汉字“哥”的16*16点阵的列码
- 0x00,0x02,0x02,0x7A,0x4A,0x4A,0x4A,0x4A,0x7A,0x02,0x02,0x7E,0x02,0x02,0x00,0x00,
- 0x01,0x01,0x01,0x3D,0x25,0x25,0x25,0x25,0x3D,0x41,0x81,0x7F,0x01,0x01,0x01,0x00
- //汉字“东”的16*16点阵的列码
- 0x00,0x08,0x88,0x48,0x28,0x18,0x0F,0xE8,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,
- 0x00,0x20,0x11,0x09,0x05,0x41,0x81,0x7F,0x01,0x01,0x05,0x09,0x11,0x20,0x00,0x00
- //汉字“哥”的16*16点阵的列码
- 0x00,0x02,0x02,0x7A,0x4A,0x4A,0x4A,0x4A,0x7A,0x02,0x02,0x7E,0x02,0x02,0x00,0x00,
- 0x01,0x01,0x01,0x3D,0x25,0x25,0x25,0x25,0x3D,0x41,0x81,0x7F,0x01,0x01,0x01,0x00
- }
- void main()
- {
- uchar i,j,n;
- while(1)
- {
- for(j=0;j<4;j++)
- {
- for(n=0;n<40;n++)
- {
- for(i=0;n<16;i++)
- {
- out1=i%16;
- put0=string[i*2+j*32];
- out2=string[i*2+1+j*32];
- delay(4);
- out0=0xff;
- out2=0xff;
- }
- }
- }
- }
复制代码
|