Help to setup GPS connection.


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mbox View Post
    I'm trying to add two numbers, 1st number is 140000 and the 2nd is 5377 which will give me 145377. And after getting the sum it will be divided by 60. x= (140000+ 537)/60, I think WORD can not hold much of the integers I need.
    Ho do I do this in PBP?
    is this still part of the GPS project or something new?
    Either way, where are the numbers coming from?
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Oct 2008
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    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

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    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.

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default minutes and seconds to degrees

    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

  5. #5
    Join Date
    Oct 2008
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    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
    Attached Images Attached Images  
    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.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts