GPS

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

GPS

Post by jgu1 »

HI All!

I have just invested in a GPS module from Matrix EB056. I downloaded the test program and the description and read it. I've tested both the GPS module and test program. It works fine, displays time, date and year as it should (as always from Matrix Multimedia). So I begin to become more curious and looking at the macros for GPS.
When I look in the properties of component macro, I see at the variables tab a `h` but can not find a `h` in variables but of course return value hour is in variable.
Can someone explain what 'h `refer to. the same for minutes, seconds, etc.

Many thanks in advance. :)

Jorgen

Gary Freegard
Posts: 45
Joined: Mon Nov 07, 2011 6:36 pm
Has thanked: 1 time
Been thanked: 30 times

Re: GPS

Post by Gary Freegard »

Hi

If you look at the custom code for the GPS component, hi-light Read_UTC_Time and click edit code you will getting the following
Custom_Code.jpg
Custom_Code.jpg (35.8 KiB) Viewed 4520 times
you will see that the macro returns a type char (in this situation it is used as a byte to return the required data) and that it takes a char type (unit), this is where the 'h' comes in. From the custom code you can see that it returns the data that is requested based on the value of unit.

For hours, then ‘h’, ‘H’ and 2
For minutes ‘m’, ‘M’ and 1
For seconds ‘s’, ‘S’ and 0

A similiar procedure is used for the Read_UTC_Date macro as well.

Hope this helps

Gary

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: GPS

Post by jgu1 »

Hi Gary!

Thank you for your interest and help. :D

Hope I may ask one more time. I have absolutely no experience with C. But can see what you mean. I've tried to look for edit custom code, but can not find it in the examble. If I must have unloaded longitude and latitude, what needs to be changed in custom code.

Thank´s in advance.

jgu1

Gary Freegard
Posts: 45
Joined: Mon Nov 07, 2011 6:36 pm
Has thanked: 1 time
Been thanked: 30 times

Re: GPS

Post by Gary Freegard »

Hi

You dont need to change anything.

To find custom code, right click on the GPS component (the compass) and you will see custom code.

The macros that are available are shown, these are also the ones that are shown in the Component Macro once you have selected GPS(0) as the component.
Component Macro.jpg
Component Macro.jpg (30 KiB) Viewed 4506 times
I have modified the example GPS and attached it. It alternates between time and position every 1 second. Hopefully this will point you in the right direction :D
I dont have a GPS module to test it.

Gary
Attachments
2. GPS Time and Date.fcf
(12.58 KiB) Downloaded 303 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: GPS

Post by jgu1 »

Hi Gary! :D

Finally I found it. Many thanks for your help and your inconvenience, and thanks for your example. I will test it later today, then I will inform you.

best regards.

jgu1 :D

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times

Re: GPS

Post by jgu1 »

Hi Gary!

Your examble work´fine. :D Thank´s. By the way, I can recommend Matrix´s GPS module. Compared to other GPS receiver I can receive signal everywhere.

Best regard

jgu1

Post Reply