本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
问题是这样的:
字体取模后,导入程序中去。显示时是反的:比如:专业制作 变成:作制业专。取模软件里也水平翻转了也不行。每次要用【文字倒写软件】:变成:作制业专
输入到取模软件里,再水平翻转,然后生产字模数据。再导入程序中,真是N麻烦啊!有哪位高手帮我指点一下,本人是学生。谢谢了!
付程序:
#include " reg51.h"
#define BLKN 8
#define TOTAL 4//注明显示字个数//
#define CONIO P0//定义输出端口//
sbit G = CONIO^7;//G1=P1.7=8脚//
sbit CLK = CONIO^6;//RCLK=P1.6=7脚//
sbit SCLR = CONIO^5;//SRCLK=P1.5=6脚//
unsigned char idata dispram[(BLKN/2)*32]={0};//显示区缓存,4字共*32单元//
unsigned char code Bmp[][32]={
0xFE,0xFF,0xFE,0xFF,0xC0,0x07,0xFD,0xFF,0xFD,0xFF,0x00,0x01,0xFB,0xFF,0xF7,0xDF,
0xF0,0x0F,0xFF,0xDF,0xFF,0xBF,0xFD,0x7F,0xFE,0xFF,0xFF,0x7F,0xFF,0xBF,0xFF,0xFF,/*"专",0*/
0xFB,0xBF,0xFB,0xBF,0xFB,0xBF,0xFB,0xBB,0xBB,0xB9,0xDB,0xB3,0xDB,0xB7,0xEB,0xAF,
0xE3,0xAF,0xEB,0x9F,0xFB,0xBF,0xFB,0xBF,0xFB,0xBB,0x00,0x01,0xFF,0xFF,0xFF,0xFF,/*"业",1*/
0xDB,0xFB,0xCB,0xFB,0xDB,0xDB,0xC0,0x5B,0xBB,0xDB,0xFB,0xDB,0x80,0x5B,0xFB,0xDB,
0xC0,0x5B,0xDB,0x5B,0xDB,0x5B,0xDB,0x5B,0xDB,0x7B,0xD8,0x7B,0xFA,0xEB,0xFB,0xF7,/*"制",2*/
0xF7,0x7F,0xF3,0x7F,0xF6,0xFF,0xEC,0x01,0xED,0x7F,0xCB,0x77,0xAF,0x03,0x6F,0x7F,
0xEF,0x7F,0xEF,0x7B,0xEF,0x01,0xEF,0x7F,0xEF,0x7F,0xEF,0x7F,0xEF,0x7F,0xEF,0x7F,/*"作",3*/
};
/****延时函数(约1MS)**********/
void delay(unsigned int dt)
{
register unsigned char bt;
for(;dt;dt--)
for(bt=0;bt<255;bt++);
}
/******主函数********/
void main (void)
{
register unsigned char q,w ,i,j,k; //i,j,k,l,q,w;
//初始化
SCON = 0x00;
TMOD = 0x01;
TR0 = 1;
CONIO = 0x3f;
IE = 0x82;
while(1)
{
delay(2000);//2S
问题就是在下面程序不知怎么更改:才能把字体显示顺序正常!请求帮忙!
// 卷帘显示文字,每次字数为BLKN/2,共显示TOTAL*2/BLKN次
for(w=0;w< TOTAL*2/BLKN;w++)
{
for(i=0;i<32;i++)
{
for(q=0;q<BLKN/2;q++){dispram[i+q*32]=Bmp[q+w*BLKN/2][i];}
if(i%2) delay(100);//移动时间
}
delay(2000);//停止时间
}
//第二种显示效果,向上滚屏,每次BLKN/2个字
for(i=0;i<TOTAL*2/BLKN;i++)
{
for(j=0;j<16;j++)
{
for(k=0;k<15;k++)
{
for(q=0;q<BLKN/2;q++)
{dispram[k*2+q*32] = dispram[(k+1)*2+q*32];
dispram[k*2+1+q*32] = dispram[(k+1)*2+1+q*32];}
}
for(q=0;q<BLKN/2;q++)
{dispram[30+q*32] = Bmp[q+i*BLKN/2][j*2];
dispram[31+q*32] = Bmp[q+i*BLKN/2][j*2+1];}
delay(100);
}
delay(1000); //滚动暂停
} |