Page 1 of 1
GPS
Posted: Fri Nov 18, 2011 8:15 pm
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
Re: GPS
Posted: Mon Nov 21, 2011 12:33 pm
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 (35.8 KiB) Viewed 4530 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
Re: GPS
Posted: Mon Nov 21, 2011 2:31 pm
by jgu1
Hi Gary!
Thank you for your interest and help.
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
Re: GPS
Posted: Mon Nov 21, 2011 3:37 pm
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 (30 KiB) Viewed 4516 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
I dont have a GPS module to test it.
Gary
Re: GPS
Posted: Tue Nov 22, 2011 7:19 am
by jgu1
Hi Gary!
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

Re: GPS
Posted: Wed Nov 23, 2011 7:13 am
by jgu1
Hi Gary!
Your examble work´fine.

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