10 years, 10 months ago.

Qs on MODgps example code?

Hi,

The below lines of code appear in example1 but not the other examples (so therefore not essential?). Can anyone explain their purpose (I'm not too familar with buffering)?

Tell MODGPS "we want copies of the NMEA sentences". When a callback is made our buffers will contain a copy of the last received sentence before it was processed/destroyed. gps.setRmc(rmc); gps.setGga(gga); gps.setVtg(vtg); gps.setUkn(ukn);

In example 3, two ways are given for calling the GPS data, why would I use one over the other?

Method 1 gps.vtg(&v1); pc.printf("Method 1. Vector data, Speed (knots):%lf, Speed(kph):%lf, Track(true):%lf, Track(mag)%lf\r\n", v1.velocity_knots(), v1.velocity_kph(), v1.track_true(), v1.track_mag()); Method 2 GPS_VTG *v2 = gps.vtg(); pc.printf("Method 2. Vector data, Speed (knots):%lf, Speed(kph):%lf, Track(true):%lf, Track(mag):%lf\r\n\n", v2->velocity_knots(), v2->velocity_kph(), v2->track_true(), v2->track_mag()); delete(v2);

Cheers,

Nathan

Question relating to:

Be the first to answer this question.