/*******************************************************************************
*
* 普中科技
--------------------------------------------------------------------------------
* 实 验 名 : LCD1602显示试验
* 实验说明 : LCD1602显示Pechin Science
* 连接方式 : 见连接图
* 注 意 :
*******************************************************************************/
#include<reg51.h>
#include"lcd1.h"
//--定义全局变量--//
unsigned char PuZh[]=" Pechin Science ";
unsigned char CnCh[27] = "Welcome to the world of MCU";
/*******************************************************************************
* 函 数 名 : main
* 函数功能 : 主函数
* 输 入 : 无
* 输 出 : 无
*******************************************************************************/
void main(void)
{
unsigned char i;
LcdInit();
//--写第一行--//
for(i=0; i<16; i++)
{
LcdWriteData(PuZh[i]);
}
//--写第二行
LcdWriteCom(0xC0); //设置坐标在第二行
for(i=0; i<27; i++)
{
LcdWriteData(CnCh[i]);
}
LcdWriteCom(0x07); //设置每写一次整屏右移
while(1) //为什么循环里面要再写一次第二行的内容??
{
/* LcdWriteCom(0xC0); //设置坐标在第二行
for(i=0; i<27; i++)
{
LcdWriteData(CnCh[i]);
Delay10ms(50);
}
*/
for(i=0; i<16; i++) //为什么重复写第一行的内容,它就全部是第一行的内容了???
{
LcdWriteData(PuZh[i]);
Delay10ms(50);
}
}
}
求解释????