/************汉字点阵*************/
uchar code hanzi[4][32] =
{ //一个汉字分两行,所以数组二维数为字数的两倍
{0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFF,0x01,0x02,0x01,0x84,0x05,0x48,
0x09,0x20,0x11,0x10,0x21,0x08,0x41,0x04,0x01,0x04,0x01,0x02,0x01,0x02,0x00,0x00},/*"长",0*/
{0x08,0x20,0x06,0x20,0x40,0x3E,0x30,0xC0,0x03,0x04,0x20,0x04,0x20,0x04,0x20,0x04,
0x20,0x04,0x3F,0xFC,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x00,0x04,0x00,0x00},/*"江",1*/
/*"江",1*/
{0x04,0x01,0x04,0x01,0x04,0x02,0x04,0x04,0x04,0x08,0x04,0x30,0x04,0xC0,0xFF,0x00,
0x04,0xC0,0x04,0x30,0x04,0x08,0x04,0x04,0x04,0x02,0x04,0x01,0x04,0x01,0x00,0x00},/*"大",0*/
{0x02,0x20,0x0C,0x20,0x88,0x20,0x69,0x20,0x09,0x20,0x09,0x22,0x89,0x21,0x69,0x7E,
0x09,0x60,0x09,0xA0,0x19,0x20,0x28,0x20,0xC8,0x20,0x0A,0x20,0x0C,0x20,0x00,0x00},/*"学",1*/
};
/************位定义**************/
sbit STTP = P2^7;
/************变量声明***********/
uint n,i,j; //delay()延时函数计数变量
uint x,y,z; //out_hanzi()
/************函数声明***********/
void delay(uint n); //延时函数
void out_rxd(uchar *d); //汉字输出
/************主函数**************/
void main()
{
SCON = 0x00;
while(1)
{
P1 = 0;
for( x = 0; x < 32; x+=2)
{
STTP = 0;
out_rxd(&hanzi[3][x+1]);
out_rxd(&hanzi[3][x]);
out_rxd(&hanzi[2][x+1]);
out_rxd(&hanzi[2][x]);
out_rxd(&hanzi[1][x+1]);
out_rxd(&hanzi[1][x]);
out_rxd(&hanzi[0][x+1]);
out_rxd(&hanzi[0][x]);
STTP = 1;
P1 = x/2;
}
}
}
/************子函数定义?********/
void delay(uint n)
{
for( ; n > 0 ; n--)
{
for( j = 0; j < 10; j++)
{;}
}
}
void out_rxd(uchar *d)
{
SBUF = *d; //启动串行口传送
while(TI == 0); //等待串口传送结束
TI = 0; //将串口中断标志位置0
}
|