钻石会员
主题
回帖0
积分12664
阅读权限50
注册时间2009-6-18
最后登录1970-1-1
在线时间 小时
|
回复 1# shqi2003
这样改改试试;
uchar j,time,wendu_bai,wendu_shi,wendu_ge; //数据变量定义
char dat;
void WriteByte(); //上半屏写一个字节数据函数
void init_timer0(); //中断初始化
/*-------------------------------------------*/
void main()
{uint temp;
init_timer0(); //中断初始化
while(1)
{
if(time>=100) //每2.5秒刷新一次温度数据
{
time=0;
tempchange(); //温度转换命令
temp=get_temp();
wendu_bei=temp/1000;
wendu_shi=temp%1000/100;
wendu_ge=temp%1000%100/10;
}
for(j=0;j<16;j++) //行扫描
{
OE=1;
dat=wendu[j][0]; //温
WriteByte();
dat=wendu[j][1];
WriteByte();
dat=wendu[j+16][0]; //度
WriteByte();
dat=wendu[j+16][1];
WriteByte();
dat=table[wendu_bai][j]; //温度百位 需另加点阵字库
WriteByte();
四字屏" 温 "字会显示不完整了. |
|