以下是时钟
芯片通过lcd显示,lcd写指令LcdWriteCom()括号里的是什么?怎么查的?求大神指教
void LcdDisplay()
{
LcdWriteCom(0x80+0X40);
LcdWriteData('0'+
tiME[2]/16); //时
LcdWriteData('0'+(TIME[2]&0x0f));
LcdWriteData('-');
LcdWriteData('0'+TIME[1]/16); //分
LcdWriteData('0'+(TIME[1]&0x0f));
LcdWriteData('-');
LcdWriteData('0'+TIME[0]/16); //秒
LcdWriteData('0'+(TIME[0]&0x0f));
LcdWriteCom(0x80);
LcdWriteData('2');
LcdWriteData('0');
LcdWriteData('0'+TIME[6]/16); //年
LcdWriteData('0'+(TIME[6]&0x0f));
LcdWriteData('-');
LcdWriteData('0'+TIME[4]/16); //月
LcdWriteData('0'+(TIME[4]&0x0f));
LcdWriteData('-');
LcdWriteData('0'+TIME[3]/16); //日
LcdWriteData('0'+(TIME[3]&0x0f));
LcdWriteCom(0x8D);
LcdWriteData('0'+(TIME[5]&0x07)); //星期
}
LcdWriteCom(0x80+0X40);
LcdWriteData('0'+TIME[2]/16); //时
LcdWriteData('0'+(TIME[2]&0x0f));
LcdWriteData('-');
比如上面一段程序啊。LcdWriteCom();是写指令。(0x80+0x40)代表从1602的第二行起始位置显示,1602每一行有16个字符,当然你也可以从第二行第二个字符开始显示如: LcdWriteCom(0x80+0X41);
LcdWriteData('0'+TIME[2]/16); //时
LcdWriteData('0'+(TIME[2]&0x0f)); 这两行嘛,就是将数组TIME[2]里面的数据高八位和低八位分别显示了(注:这是我猜的,就看你怎么存储了。。。) 最佳答案
不是 我说的括号是这个括号里的LcdWriteCom(0x80);
对啊 那你知道括号里代表什么么 是显示屏上显示数据的位置么?
一周热门 更多>