|
楼主我的为什么只要调用void disp_sfm()这个函数就这样,还保留开机界面,开机时候显示的都正常,就是进入时间界面这样!!请指导!void disp_sfm()
{
uint temper;
uchar temper_ge,temper_shi,temper_bai,day_temp,date_temp,month_temp,year_temp;
lcdWriteCommand(0x36); //启动扩充指令集,启动绘图模式
ss = read_clock(0x81); //更新数据
if(sec_temp!=ss)//读取秒,只要有改变液晶显示也改变
{
sec_temp=ss;
deal(sec_temp);
if(secl!=shi)
{
secl=shi;
display(6,secl);
}
display(7,ge);
}
mm = read_clock(0x83); //读取分,只要有改变液晶显示也改变
if(min_temp!=mm)
{
min_temp=mm;
deal(mm);
display(3,shi);
display(4,ge);
}
hh = read_clock(0x85); //读取小时,只要有改变液晶显示也改变
if(hour_temp!=hh)
{
hour_temp=hh;
deal(hh);
display(0,shi);
display(1,ge);
}
if(ge/1%2==0)
{
display(2,10);
display(5,10);
}
else
{
display(2,11);
display(5,11);
}
lcdWriteCommand(0x30);
dd = read_clock(0x87); //读取日,只要有改变液晶显示也改变
if(date_temp!=dd)
{
date_temp=dd;
deal(dd);
lcdWriteCommand(0x85);
lcdWriteData(shi+0x30);
lcdWriteData(ge+0x30);
}
mo = read_clock(0x89); //读取月,只要有改变液晶显示也改变
if(month_temp!=mo)
{
month_temp=mo;
lcdWriteCommand(0x83);
deal(mo);
lcdWriteData(shi+0x30);
lcdWriteData(ge+0x30);
}
yy = read_clock(0x8d); //读取年,只要有改变液晶显示也改变
if(year_temp!=yy)
{
year_temp=yy;
lcdWriteCommand(0x81);
deal(yy);
lcdWriteData(shi+0x30);
lcdWriteData(ge+0x30);
}
xq = read_clock(0x8b); //读取星期,只要有改变液晶显示也改变
if(day_temp!=xq)
{
day_temp=xq;
switch(xq)
{
case 1: dispString(3, 2, 1, "一");break;
case 2: dispString(3, 2, 1, "二");break;
case 3: dispString(3, 2, 1, "三");break;
case 4: dispString(3, 2, 1, "四");break;
case 5: dispString(3, 2, 1, "五");break;
case 6: dispString(3, 2, 1, "六");break;
case 7: dispString(3, 2, 1, "日");break;
default:break;
}
}
temper=read_temp();//读取温度
temper_ge=temper%10+0x30;
temper_shi=temper%100/10+0x30;
temper_bai=temper/100+0x30;
//lcdWriteCommand(0x9b); //此处可以用来测试各种红外遥控的键值
//lcdWriteData(workcode/10+0x30);
//lcdWriteData(workcode%10+0x30);
if(tflag==1)
{
dispString(3, 4, 1, " -");
}
else
{
dispString(3, 4, 1, " ");
}
if(temper_bai==0x30) temper_bai=0x20;
lcdWriteCommand(0x9d);
lcdWriteData(temper_bai);
lcdWriteData(temper_shi);
lcdWriteData('.');
lcdWriteData(temper_ge);
lcdWriteCommand(0x36);
},
|
-
1.jpg
(71.63 KB, 下载次数: 705)
-
2.jpg
(41.92 KB, 下载次数: 658)
|