求知16*16点阵显示滚动汉字(部分代码已写好,就差滚动了)
以下的代码只是实现了在16*16点阵上显示汉字而已,所以想求哪位老师或同学能帮忙修改一下这代码为从右到左滚动的汉字!#include"at89x51.h"chartabl...
以下的代码只是实现了在16*16点阵上显示汉字而已,所以想求哪位老师或同学能帮忙修改一下这代码为从右到左滚动的汉字!
#include "at89x51.h"
char table[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
char charlab[2][32]={
{0x00,0xFE,0x12,0x62,0x82,0x62,0x1A,0x02,
0x12,0x62,0x82,0x62,0x1A,0xFF,0x02,0x00,
0x00,0xFF,0x18,0x06,0x01,0x02,0x2C,0x10,
0x08,0x06,0x01,0x42,0x8C,0x7F,0x00,0x00},
{0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x24,
0x25,0x26,0x24,0x24,0x3E,0x84,0x00,0x00,
0x22,0x67,0x22,0x12,0x14,0x02,0xFF,0x09,
0x7F,0x09,0x09,0x7F,0x89,0xFF,0x01,0x00}
};
void main()
{
int k,i=0,j=0,count=0;
while(1)
{
P1=table;
P2=charlab[j][2*i];
P3=charlab[j][2*i+1];
for(k=0;k<200;k++);
i++;
count++;
if(i==16)
i=0;
if(count==1000)
{
j++;
count=0;
if(j==2)
j=0;
}
}
} 展开
#include "at89x51.h"
char table[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
char charlab[2][32]={
{0x00,0xFE,0x12,0x62,0x82,0x62,0x1A,0x02,
0x12,0x62,0x82,0x62,0x1A,0xFF,0x02,0x00,
0x00,0xFF,0x18,0x06,0x01,0x02,0x2C,0x10,
0x08,0x06,0x01,0x42,0x8C,0x7F,0x00,0x00},
{0x20,0x30,0xAC,0x63,0x30,0x00,0xFC,0x24,
0x25,0x26,0x24,0x24,0x3E,0x84,0x00,0x00,
0x22,0x67,0x22,0x12,0x14,0x02,0xFF,0x09,
0x7F,0x09,0x09,0x7F,0x89,0xFF,0x01,0x00}
};
void main()
{
int k,i=0,j=0,count=0;
while(1)
{
P1=table;
P2=charlab[j][2*i];
P3=charlab[j][2*i+1];
for(k=0;k<200;k++);
i++;
count++;
if(i==16)
i=0;
if(count==1000)
{
j++;
count=0;
if(j==2)
j=0;
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询