Skip to content

Latest commit

 

History

History
82 lines (45 loc) · 1.44 KB

gps-GP-20U7.md

File metadata and controls

82 lines (45 loc) · 1.44 KB

GPS - Sparkfun GP-20U7

When using GPS class with an Arduino (or similar microcontroller), be sure to upload the StandardFirmataPlus firmware to your board.

Breadboard for "GPS - Sparkfun GP-20U7"

docs/breadboard/gps-GP-20U7.png

Fritzing diagram: docs/breadboard/gps-GP-20U7.fzz

 

Run this example from the command line with:

node eg/gps-GP-20U7.js
const { Board, GPS } = require("johnny-five");
const board = new Board();

board.on("ready", () => {
  const gps = new GPS({
    pins: {
      rx: 11,
      tx: 10,
    }
  });

  // If latitude, longitude data log it.
  // This will output zero until a valid
  // GPS position is detected.
  gps.on("data", position => {
    const {altitude, latitude, longitude} = position;
    console.log("GPS Position:");
    console.log("  altitude   : ", altitude);
    console.log("  latitude   : ", latitude);
    console.log("  longitude  : ", longitude);
    console.log("--------------------------------------");
  });
});

Learn More

 

License

Copyright (c) 2012-2014 Rick Waldron [email protected] Licensed under the MIT license. Copyright (c) 2015-2023 The Johnny-Five Contributors Licensed under the MIT license.