How to extract data from neo 6m gps module

Go To Last Post
61 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Finally i have parsed the data and displayed time on the 16x2 Display. But i've issue regarding how to add +5.30 Time zone for india to current UTC time. any idea from friends here would help me to save my time...

Its not just simple to add 5hour to hour register and 30 minutes to min ones.. because when it would be 23 hours + 5 means it will show 28...and that's mess. so how to overcome this issue..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you just handle the overflow from hours to days...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One common method is to convert time to seconds add/subtract your offset then convert back to 'real' time. Its a common problem.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

One common method is to convert time to seconds add/subtract your offset then convert back to 'real' time. Its a common problem.

Does your compiler offer functions like localtime() and mktime() ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Its not just simple to add 5hour to hour register and 30 minutes to min ones..

I'll paraphrase resident 'freak David Prentice: Sit dow and do a few such additions on paper. Then think. Perhaps make a cup of tea. Then think again.

Then implement in a C function what you just did on paper.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Quote:

One common method is to convert time to seconds add/subtract your offset then convert back to 'real' time. Its a common problem.

Does your compiler offer functions like localtime() and mktime() ?

i am using Atmel Studio 6 with GCC compiler. i don't know whether it supports..?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

i am using Atmel Studio 6 with GCC compiler. i don't know whether it supports..?

It doesn't have it in the currently issued version but in the "next" version you should find the functions added. In the meantime you can "cherry pick" what you need from here:

http://svn.savannah.nongnu.org/v...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you need the full date/time arithmetic - complete with days, months, leap years, etc - then you should use the functions.

If you just want a correct roll-over of the hours, then that's just simple arithmetic...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes i just want time...so i will use simple asthmatics i have some idea will post once successful..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Finally i have little success in converting simple arithmetic calculations.. as below

i have added +5.30 for Indian standard time

hour = nmea.getHour();
minute = nmea.getMinute();
hour = hour + 5;
minute = minute + 30; 
if(minute > 59)
{
minute = minute - 60;
hour = hour + 1;
} 
if(hour > 23)
{
hour = hour - 24;
}

Pages