UyAb
Junior Member level 2
- Joined
- Mar 6, 2013
- Messages
- 20
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Tacloban City, Philippines
- Activity points
- 1,416
this is my code..my problem with this is..for example,if my initial time is 1:15..
it will countdown like this..
1:15,1:14,1:13...1:10,1:05,1:04,1:03...1:00,0:15..
please help me change my coding..
it will countdown like this..
1:15,1:14,1:13...1:10,1:05,1:04,1:03...1:00,0:15..
please help me change my coding..
Code:
void display_time()
{
Lcd_Chr(2,4,h+48);
Lcd_Chr(2,5,':');
Lcd_Chr(2,6,m2+48);
Lcd_Chr(2,7,m1+48);
Lcd_Chr(2,8,':');
Lcd_Chr(2,9,s2+48);
Lcd_Chr(2,10,s1+48);
}
void countdown_timer()
{
Lcd_Cmd(Lcd_Clear);
Lcd_Out(1,1,"Time Left:");
Lcd_Out(2,12,"H:M:S");
for(h=code[0]-48;h>=0;h--)
{display_time();
for(m2=code[1]-48;m2>=0;m2--)
{display_time();
for(m1=code[2]-49;m1>=0;m1--)
{display_time();
for(s2=5;s2>=0;s2--)
{display_time();
for(s1=9;s1>=0;s1--)
{display_time();
if(m1<0)
{s2=0;s1=0;}
delay_ms(1000);
}
}
}
}
}
}