Discussion in "Project Doubts" started by    Gloria    Mar 30, 2007.
Fri Mar 30 2007, 05:13 pm
#1
i want to display international time in my clock design program. if i press a switch it must display that place and time then it must operate normal again until i press again.


[ Edited Sat Oct 20 2007, 11:03 pm ]
Sat Mar 31 2007, 12:30 am
#2
you need to do following changes in code.. i mean,
change the switch_pin to INT1 because INT0 is already in use. ok! so..
when u press switch_pin, the clock hr offset changes... something like..
you create a variable.. e.g hr_offset = 0 by default is 0.. which is set according to ur time, not GMT..
so.. when you press the switch_pin.. it get into interrupt routine and.. change or increment or decrement the value of hr_offset.. and then put a switch case..
hr_offset++;
switch(hr_offset){
case 1:
//first timezone e.g. u have +5:30hr off from ur
//time.. then..
hmin = hmin+3;
if(hmin>5){
hmin = hmin - 6;
hh++;
if(hh>12)
// then more and more checks..

so this is how u implement... as i said in mail.. if you do change like this.. you will lag with time.. so i suggested you to just use hardware RTC like DS1307 and do world time thing.. as u want..!
its easy with that... well. u gave me a nice idea.. he he hehe...! thank you!!
and think on my sugession

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm
HumanTak
Sun Apr 21 2024, 12:26 pm
Zacharybus
Sun Apr 21 2024, 02:45 am