Yes it's part of the GPS. Google map can interpret this "11 14.5377,125 00.3560". But for my Mobile map application it can not, it reads this format "11.242295, 125.005933", I will explain my alternative solution only for th the latitude part using data "$GPRMC,115209.200,A,1114.5377,N,12500.3439,E,0.02 ,296.54,021110,,,A*65", I extract data to this format "Deg 11 Min 14 Sec 5377". Then I need 14 and 5377 to be this 145377 format (my alternative solution is to 14x10000+5377) then divide it by 60 which will give me 2422.95. I need to make it whole number so 2422.95 x 100 = 242295. Then format the data to this deg 11.242295 ans send it to PortC.6, 11 is the degree and add a "." in between. Any alternative solution would be nice.
regards,
mbox
Not quite the accuracy you want but it is close. Maybe someone else can get it closer.
This returns 2422.
Code:K CON 10000 MINS VAR BYTE SECS VAR WORD MINS = 14 SECS = 5377 Y VAR WORD Z VAR WORD 'DUMMY VAR Z1 VAR WORD 'DUMMY VAR START: SECS = SECS / 10 Z = (MINS * K) Z1 = DIV32 10 Y = Z1 + SECS Z = (Y / 6) LCDOUT $FE,1,"Z= ",DEC Z END
Dave
Always wear safety glasses while programming.
Hey Mbox,
I think you are close, but your degrees calculation is a little off (if I am right about you converting minutes and seconds to degrees). I know a short cut, if you can live without decimal seconds.
Say you want to convert 11 deg 14 min and 53.77 seconds to degrees. If you can live without decimal seconds, we have 11 deg 14 min and 54 seconds. To convert to degrees.degrees:
to convert minutes to degrees
(14 * 500)/3 = 2333 (really .2333 degrees)
and now convert seconds
(54 * 50)/18 = 150 (really .015 degrees)
2333
+150
=2483
or 11.2483 degrees. This result fares well with http://www.satsig.net/degrees-minute...calculator.htm , which says the result should be 11.24827 using the seconds decimals.
So with two variables you could store the result. lon_hi would = 11 and lon_low would = 2483. If you need to turn this out the serial port, your code can also place the decimal point between them.
http://www.scalerobotics.com
Hi everyone, thanks for the inputs appreciated it very much...I will make tests and see the results regarding the calculation part. So far I made 30 queries by sms from the device and works okay without yet the format and calculation I desire in the mcu, right now the calculation are done and formatting within the mobile codings. I'll be away for 3 days, hopefully by end of the week I can smoothen it more.
Technos: PBP 2.50 and Python for the mobile app.
regards,
mbox
Last edited by mbox; - 9th November 2010 at 00:25. Reason: Sorry I settle to send 1 pic only, I will add more later if updates are completed.
Bookmarks