点阵左移

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

#include
#define uint unsigned int
#define uchar unsigned char
sbit E1=P1^7;
sbit DS=P2^0;
sbit SRCK=P2^1;
sbit RCK=P2^2;

uchar speed=20;
uchar code bless[][32]={
/*-- 文字: 浙 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x02,0x00,0x02,0x00,0x12,0x08,0x0A,0x18,0x03,0x60,0x4E,0x40,0x22,0x7E,0x03,0x50,
0x16,0x50,0x1A,0x50,0x22,0x90,0x27,0x10,0x42,0x10,0x00,0x10,0x00,0x10,0x00,0x00},

/*-- 文字: 江 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x00,0x00,0x10,0x00,0x08,0x00,0x00,0x38,0x03,0xC0,0x40,0x40,0x20,0x40,0x08,0x40,
0x08,0x40,0x10,0x40,0x20,0x7E,0x6F,0x80,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

/*-- 文字: 工 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x0F,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
0x01,0x00,0x01,0x00,0x01,0xFC,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

/*-- 文字: 业 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x00,0x00,0x00,0x80,0x04,0x80,0x04,0x80,0x04,0x80,0x04,0x88,0x24,0x98,0x14,0xA0,
0x14,0xC0,0x04,0x80,0x04,0x80,0x07,0xFC,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00},

/*-- 文字: 大 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x03,0xF0,0x3E,0x00,0x02,0x00,
0x05,0x00,0x04,0x80,0x08,0x40,0x10,0x20,0x20,0x18,0x40,0x0E,0x00,0x00,0x00,0x00},

/*-- 文字: 学 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x00,0x20,0x12,0x20,0x09,0x20,0x00,0x40,0x23,0xFC,0x3C,0x08,0x63,0xC0,0x44,0x80,
0x01,0x00,0x01,0xF8,0x7E,0x80,0x00,0x80,0x00,0x80,0x02,0x80,0x01,0x00,0x00,0x00},



/*-- 文字: 欢 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x00,0x80,0x00,0x80,0x00,0x80,0x01,0x00,0x19,0x78,0x69,0x90,0x0A,0x20,0x48,0x80,
0x28,0x80,0x10,0x80,0x29,0x40,0x41,0x20,0x82,0x18,0x04,0x0E,0x00,0x00,0x00,0x00},

/*-- 文字: 迎 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x00,0x00,0x00,0x80,0x21,0x80,0x16,0x38,0x04,0x48,0x04,0x48,0xF4,0x48,0x15,0x58,
0x26,0x40,0x10,0x40,0x10,0x40,0xFF,0x00,0x00,0xFE,0x00,0x18,0x00,0x00,0x00,0x00},



/*-- 文字: 您 --*/
/*-- 楷体_GB231212; 此字体下对应的点阵为:宽x高=16x16 --*/
{0x00,0x80,0x08,0x80,0x09,0x38,0x11,0xC8,0x32,0x50,0x54,0x40,0x12,0x50,0x12,0x48,
0x10,0xC0,0x00,0x08,0x09,0x04,0x28,0xA0,0x64,0x10,0x03,0xF8,0x00,0x00,0x00,0x00},

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}





};

void delay()
{
uint i;
for(i=0;i<150;i++);
}
void write_byte(uchar a)
{
uchar i,num;
num=~a;
for(i=0;i<8;i++)
{
RCK=0;
SRCK=0;
if((num&0x01)==0)

DS=0;
else DS=1;
SRCK=1;
RCK=1;
num>>=1;
}
}
void write_null()
{ uchar i;
for(i=0;i<7;i++)
{
RCK=0;
SRCK=0;
DS=1;
SRCK=1;
RCK=1;

}
}

void main()
{
uchar i,j,k,scan,z;
DS=1;
E1=0;
while(1)
{ scan=0;
for(k=0;k<2*speed;k++)
{
for(i=0;i<31;i=i+2)
{

write_null();
P3=scan;
E1=0;

delay();

E1=1;
scan++;
}
}
for(j=0;j<6;j=j+1)
{

for(k=0;k{





scan=0;
for(i=0;i<31;i=i+2)
{
write_byte(bless[j+3][i+1]);
write_byte(bless[j+3][i]);
write_byte(bless[j+2][i+1]);
write_byte(bless[j+2][i]);
write_byte(bless[j+1][i+1]);
write_byte(bless[j+1][i]);
write_byte(bless[j][i+1]);
write_byte(bless[j][i]);

P3=scan;
E1=0;

delay();


E1=1;
if(i%2==0)
scan++;

}
}
for(k=0;k{
scan=0;
for(i=1;i<31;i=i+2)
{
write_byte(bless[j+4][i+1]);
write_byte(bless[j+3][i]);
write_byte(bless[j+3][i+1]);
write_byte(bless[j+2][i]);
write_byte(bless[j+2][i+1]);
write_byte(bless[j+1][i]);
write_byte(bless[j+1][i+1]);
write_byte(bless[j][i]);

P3=scan;
E1=0;

delay();


E1=1;
if(i%2==1)
scan++;

}
}







}
}
}

相关文档
最新文档