{"id":634,"date":"2015-02-03T10:04:10","date_gmt":"2015-02-03T09:04:10","guid":{"rendered":"http:\/\/hirt.se\/blog\/?p=634"},"modified":"2015-02-03T10:04:10","modified_gmt":"2015-02-03T09:04:10","slug":"the-adafruit-ultimate-gps","status":"publish","type":"post","link":"https:\/\/hirt.se\/blog\/?p=634","title":{"rendered":"The Adafruit Ultimate GPS"},"content":{"rendered":"<p>This blog will provide a tiny library for communicating with the <a href=\"http:\/\/www.adafruit.com\/product\/746\">Adafruit Ultimate GPS board<\/a> from Java SE Embedded. I only implemented UART communication, but it is trivial to adapt the code for use over the USB serial, should you want to. The library provides position information as well as speed, as <a href=\"http:\/\/www.adafruit.com\/datasheets\/GlobalTop-FGPMMOPA6H-Datasheet-V0A.pdf\">GGA<\/a> and <a href=\"http:\/\/www.adafruit.com\/datasheets\/GlobalTop-FGPMMOPA6H-Datasheet-V0A.pdf\">VTG<\/a> was the only info I need (right now). As usual, first install <a href=\"http:\/\/pi4j.com\/\">PI4J<\/a> before attempting to use the library.<\/p>\n<p><a href=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2015\/02\/GPS.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"GPS\" style=\"border-top: 0px;border-right: 0px;border-bottom: 0px;border-left: 0px\" border=\"0\" alt=\"GPS\" src=\"https:\/\/hirt.se\/blog\/wp-content\/uploads\/2015\/02\/GPS_thumb.jpg\" width=\"361\" height=\"404\"><\/a> <\/p>\n<p>Here is how to use the thing:<\/p>\n<blockquote>\n<p>GPS gps = new GPS();<br \/>gps.addListener(new GPSListener() {<br \/>&nbsp;&nbsp;&nbsp; @Override<br \/>&nbsp;&nbsp;&nbsp; public void onEvent(PositionEvent event) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(event);<br \/>&nbsp;&nbsp;&nbsp; }  <\/p>\n<p>&nbsp;&nbsp;&nbsp; @Override<br \/>&nbsp;&nbsp;&nbsp; public void onEvent(VelocityEvent event) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(event);<br \/>&nbsp;&nbsp;&nbsp; }<br \/>});  <\/p>\n<p>&nbsp;<\/p>\n<\/blockquote>\n<p>That\u2019s it. The PositionEvent will provide you with the 2D location, the altitude about mean sea level, the altitude above the ellipsoid, an estimate of the max error, number of satellites used for the fix etc. The VelocityEvent will provide the heading and ground speed. Hope this helps!<\/p>\n<p>&nbsp;<\/p>\n<h2>Summary<\/h2>\n<p>Almost all projects are improved by a GPS. \ud83d\ude42 This tiny library makes it easy to access the Adafruit GPS from Java SE Embedded. Here are the links:<\/p>\n<ul>\n<li><a href=\"http:\/\/hirt.se\/downloads\/software\/rpi\/gps.jar\">Library<\/a>\n<li><a href=\"http:\/\/hirt.se\/downloads\/software\/rpi\/gps_src.jar\">Source<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This blog will provide a tiny library for communicating with the Adafruit Ultimate GPS board from Java SE Embedded. I only implemented UART communication, but it is trivial to adapt the code for use over the USB serial, should you want to. The library provides position information as well as speed, as GGA and VTG [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-634","post","type-post","status-publish","format-standard","hentry","category-java-mission-control-fair-dj"],"_links":{"self":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=634"}],"version-history":[{"count":1,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/634\/revisions"}],"predecessor-version":[{"id":635,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/634\/revisions\/635"}],"wp:attachment":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}