找回密码
 注册会员
更新自动建库工具PCB Footprint Expert 2024.04 Pro / Library Expert 破解版

在线等!一线工人老师请进!液晶12864光标无法准确定位

[复制链接]
admin 发表于 2012-9-2 20:20:33 | 显示全部楼层 |阅读模式

本文包含原理图、PCB、源代码、封装库、中英文PDF等资源

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我在用DS1302做时钟时,想加入按键进行闪烁调时,可是现在液晶12864的光标只能在最后的空白位置闪烁,不能在我指定的位置闪动,请大家帮忙看看,程序如下
void keyscan()
{ uchar key1_count=0;

if(key1==0)
{ W1302(DS1302_SECOND,0x80);
delay(5);
if(key1==0)
{
key1_count++;
while(!key1);
switch(key1_count)
{
case 1: lcd_pod(3,3);
wcode(0x0f);
break;
case 2: lcd_pos(3,4);
wcode(0x0f);
break;
case 3: lcd_pos(3,6);
break;
// case 4:

}
}
}
if(key1_count!=0)
{
if(key2==0)
{
delay(5);
if(key2==0)
{
while(!key2);
switch(key1_count)
{
case 1:if(++CurrentTime.Second>59) CurrentTime.Second=0;
break;
case 2:if(++CurrentTime.Minute>59) CurrentTime.Minute=0;
break;
case 3:if(++CurrentTime.Hour>23) CurrentTime.Hour=0;
break;
case 4:if(++CurrentTime.Year>99) CurrentTime.Year=0;
break;
case 5:if(++CurrentTime.YearH>99) CurrentTime.YearH=0;
break;
case 6:if(++CurrentTime.Month>11) CurrentTime.Month=0;
break;
case 7:if(++CurrentTime.Day>30) CurrentTime.Day=0;
}
}
}
if(key3==0)
{
delay(5);
if(key3==0)
{

while(!key3);
switch(key1_count)
{
case 1:if(CurrentTime.Second--==0) CurrentTime.Second=59;
break;
case 2:if(CurrentTime.Minute--==0) CurrentTime.Minute=59;
break;
case 3:if(CurrentTime.Hour--==0) CurrentTime.Hour=23;
break;
case 4:if(CurrentTime.Year--==0) CurrentTime.Year=99;
break;
case 5:if(CurrentTime.YearH--==0) CurrentTime.YearH=99;
break;
case 6:if(CurrentTime.Month--==0) CurrentTime.Month=12;
break;
case 7:if(CurrentTime.Day--==0) CurrentTime.Day=30;
}

}
}
}
}

[ 此贴被zhupingheng在2009-06-01 18:39重新编辑 ]
*滑块验证:
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

QQ|手机版|MCU资讯论坛 ( 京ICP备18035221号-2 )|网站地图

GMT+8, 2024-11-29 09:57 , Processed in 0.057355 second(s), 12 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表