钻石会员
主题
回帖0
积分23852
阅读权限50
注册时间2008-11-13
最后登录1970-1-1
在线时间 小时
|
我不会写程序,但是别人给我的一个程序,【现在是修改部分的程序】在用这个程序时候,注明了在显示一块屏和2块屏的时候,有些地方需要修改,不知道你是不是这个意思。
uchar BUFF[18];//2字是6,4字是10,8字应该18
void loadoneline(void);
void delay(uchar t);
void sendoneline(void);
void send(uint k);
/********************************************/
uchar two_onebyte(uchar h1,uchar h2)
{uchar temp,tempcol;
if(col<8) tempcol=col;
else tempcol=col-8;
temp=(h1<<tempcol)|(h2>>(8-tempcol));
return temp;
}
/*******************************************************/
void main(void)
{uchar i;
col=0;word=0;
SCON = 0x00; //串口工作方式0
V_RCK = 1; //先拉低V_RCK///V_RCK = 0;
V_OER = 0; //关闭显示
hang=0x0002; //行选信号初始化
while(1)
{while(col<16)
{for(i=0;i<SPEED;i++)
{for(disrow=0;disrow<16;disrow++)
{ loadoneline();
sendoneline();
V_RCK = 1; //锁存已发送的整一行的数据V_RCK = 1;
V_RCK = 0;
V_OER = 0; //关闭显示
send(hang); //发送行选择数据
if(col<7)
V_OER = 1,
delay(light); //延时
hang=_irol_(hang,1);//行选信号调整,选中下一行
}
}
col++;
}
col=0;word=word+32;
if(word>=1024)word=0;//字数*32
}
}
/****************把字模移入数组的子函数********************/
void loadoneline(void)
{uchar s;
for(s=0;s<9;s++) //s为要显示的数字+1//4字是《5,8字应该《9 //s为要显示的数字+1
{BUFF[2*s]=HZ[word+32*s+2*disrow];
BUFF[2*s+1]=HZ[word+1+32*s+2*disrow];
}
}
/*******************发送一行的子函数************************/
void sendoneline(void)
{char s;uchar inc;
if(col<8)inc=0;else inc=1;
for(s=0+inc;s<=15+inc;s++) //s=2*要显示的数字-1//<15 //s=2*要显示的数字-1 |
|