Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distance_between function #6

Open
varlux opened this issue Jan 14, 2016 · 1 comment
Open

distance_between function #6

varlux opened this issue Jan 14, 2016 · 1 comment

Comments

@varlux
Copy link

varlux commented Jan 14, 2016

Hi everybody.
How do I use the function in object? Can I use the output of the function "gps.f_get_position(&flat, &flon, &fix_age)"

Thanks

@Prince-of-Persia
Copy link

You're passing pointers to the function f_get_position(...) from the Arduino sketch. This variables will be modified/writtento by the function which will become available to use in your sketch.

i.e.
defined function:

void TinyGPS::f_get_position(float *latitude, float *longitude, unsigned long *fix_age)
{
  long lat, lon;
  get_position(&lat, &lon, fix_age);
  *latitude = lat == GPS_INVALID_ANGLE ? GPS_INVALID_F_ANGLE : (lat / 1000000.0);
  *longitude = lat == GPS_INVALID_ANGLE ? GPS_INVALID_F_ANGLE : (lon / 1000000.0);
}

call function from Arduino sketch:

gps.f_get_position(&flat, &flon, &fix_age);

after function call:
flat = [some value]
flon = [some value]
fix_age = [some value]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants