Skip to content

examples/gps: show units in output#3541

Open
nightt5879 wants to merge 1 commit into
apache:masterfrom
nightt5879:nightt5879/gps-example-units-3083
Open

examples/gps: show units in output#3541
nightt5879 wants to merge 1 commit into
apache:masterfrom
nightt5879:nightt5879/gps-example-units-3083

Conversation

@nightt5879

Copy link
Copy Markdown
Contributor

Summary

  • add units to the GPS example output labels for coordinates, speed, and altitude
  • print RMC floating-point speed with minmea_tofloat() so it is shown as knots instead of using coordinate conversion
  • print GGA altitude as a scaled float with the sentence-provided unit

Fixes #3083

Testing

  • git diff --check -- examples/gps/gps_main.c
  • Configured sim:minmea with CONFIG_EXAMPLES_GPS=y in a temporary WSL checkout and verified gps_main.c compiles

@nightt5879 nightt5879 force-pushed the nightt5879/gps-example-units-3083 branch 2 times, most recently from 9ce452a to ed657b4 Compare June 15, 2026 13:58
Comment thread examples/gps/gps_main.c Outdated
The GPS example prints parsed measurements without explicit units. The RMC
floating-point speed path also used minmea_tocoord(), even though speed is
not a coordinate.

Add units to the output labels, print speed with minmea_tofloat(), and print
GGA altitude as a scaled value with the sentence-provided unit.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
@nightt5879 nightt5879 force-pushed the nightt5879/gps-example-units-3083 branch from 160e001 to 8c44fea Compare June 16, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] GPS example units

3 participants