How do I discern Maidenhead Locator from GPS lat long info.


Closed Thread
Results 1 to 40 of 126

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    anyway as i said in the begging im an amature in programming and is not my main job. I do it on my spare time and i try to make as simple as possible
    you may think your way is as simple as possible but its not , its the hardest way by far.
    my way breaks the task up into simple logical blocks , each task can then be solved independently ,and in isolation from the other tasks
    the entire project can be built one task at a time

    task1
    read in nmea scentence
    task2
    verify crc
    task3
    identify scentence type
    task 4
    parse a GPRMC scentence

    task4a
    process a time field

    task4b
    process a LAT field
    task4c
    process a LON field

    .....etc

    simple small steps
    Warning I'm not a teacher

  2. #2
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    Quote Originally Posted by richard View Post
    you may think your way is as simple as possible but its not , its the hardest way by far.
    my way breaks the task up into simple logical blocks , each task can then be solved independently ,and in isolation from the other tasks
    the entire project can be built one task at a time

    task1
    read in nmea scentence
    task2
    verify crc
    task3
    identify scentence type
    task 4
    parse a GPRMC scentence

    task4a
    process a time field

    task4b
    process a LAT field
    task4c
    process a LON field

    .....etc

    simple small steps
    Ok if i cannot make it the way i have started, i will follow your advice, as given above.

  3. #3
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    Hi Richard,

    i think it is working. I need to test it one or two days....

    I'll keep you updated because i need also to understand the "true" statement.

  4. #4
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    Sorry forgot to upload the code.

    The following is the one i have changed in order the date to change when the time is > 23

    Code:
    day_added = 0
    hh = hh + 3
    if  hh > 23 then
    day_added = 1
    endif
    hh = hh//24
    if day_added = 1 then
    day = day + 1
    if day > num_date then ; i havent done anything to this up to now. I need to figure out how to tell the programm about the num_date (No of the day today in this month)
    day = 1
    if month > 12 then
    month = 1
    year = year +1
        endif
          endif
            endif
    regarding this
    Code:
    if day > num_date then ; i havent done anything to this up to now. I need to figure out how to tell the programm about the num_date (No of the day today in this month)
    i think that i need to create a table with 12 months and specify which has 30, 31, or which year then has Feb 28 or 29
    Attached Files Attached Files

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    the only thing I might add is that the conversion from utc to local time only needs to be done if and when the hour changes , its not needed in every loop.
    a flag can be set when the utc hour now is != current utc hour , then the flag can be cleared when the conversion is done
    Warning I'm not a teacher

  6. #6
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    Quote Originally Posted by richard View Post
    the only thing I might add is that the conversion from utc to local time only needs to be done if and when the hour changes , its not needed in every loop.
    a flag can be set when the utc hour now is != current utc hour , then the flag can be cleared when the conversion is done
    Hi Richard, once again thanks a lot for your kind help and time.

    I work on this very slow, because i need to understand the code, and then i need to test the code every time i change something.

    Now i need to fix the months. Please give me some time. I will upload the code and then we can discuss what might need to be done.

    As i have it in mind, i need to create a label. Under the label i need to speciafy which month has 30 days and which has 31 at the begging. For the month February i need to specify which YEAR is 28 days and which is 29.

    Then i will connect the code:

    Code:
    ay_added = 0
    hh = hh + 3
    if  hh > 23 then
    day_added = 1
    endif
    hh = hh//24
    if day_added = 1 then
    day = day + 1
    if day > num_date then ; i havent done anything to this up to now. I need to figure out how to tell the programm about the num_date (No of the day today in this month)
    day = 1
    if month > 12 then
    month = 1
    year = year +1
        endif
          endif
            endif
    to the Label which has all the info for each month.

    Is that right?

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    getting the number of day in month can be achieved in a few ways

    simple is lookup
    but resource hungryLOOKUP Index,[Constant{,Constant...}],Var

    lookup month,[0,31,28,31,30,,,,,,,,,,,,,],numberofdays

    an array
    more efficient but uses more sram
    arraywrite ndays,[0,31,28,31,30,,,,,,,,,,,,,]
    numberofdays=ndays[month]


    leap years
    are

    if ((year//4 = 0) and (year//400 !=0))
    if month=2 then numberofdays=numberofdays+1
    endif




    Warning I'm not a teacher

Similar Threads

  1. LAT replaces PORT command?
    By markscotford in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd December 2011, 16:37
  2. Need Info for PBP?
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 30th January 2009, 07:44
  3. Replies: 1
    Last Post: - 27th July 2008, 06:14
  4. dmx info.
    By oscar in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th May 2005, 11:54

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