lcd1602显示光标和移动问题

2024-11-02 02:24:31
推荐回答(1个)
回答1:

if((key==0)&&(setflag==0)) //时间设置
{
delay(10);
if(key==0)
{
while(!key);

write_com(0x38);
write_com(0x0c);
write_com(0x0f);
flag++;
if(flag==1)
write_com(0x80+0x40+7);
if(flag==2)
write_com(0x80+0x40+4);
if(flag==3)
write_com(0x80+0x40+1);
if(flag==4)
write_com(0x80+10);
if(flag==5)
write_com(0x80+7);
if(flag==6)
write_com(0x80+4);
if(flag==7)
{
write_com(0x0c);
Init_DS1302();
flag=0;
}
}
}