Skip to content

Latest commit

 

History

History
82 lines (46 loc) · 1.42 KB

gps-adafruit.md

File metadata and controls

82 lines (46 loc) · 1.42 KB

GPS - Adafruit Ultimate GPS Breakout

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

Adafruit Ultimate GPS Breakout

Example of Adafruit Ultimate GPS on serial.

docs/breadboard/gps-adafruit.png

Fritzing diagram: docs/breadboard/gps-adafruit.fzz

 

Run this example from the command line with:

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

board.on("ready", () => {

  /*
   * This is the simplest initialization
   * We assume SW_SERIAL0 for the port
   */
  const gps = new GPS({
    breakout: "ADAFRUIT_ULTIMATE_GPS",
    pins: {
      rx: 11,
      tx: 10,
    }
  });

  // If latitude, longitude, course or speed change log it
  gps.on("change", position => {
    const {latitude, longitude} = position;
    console.log("GPS Position:");
    console.log("  latitude   : ", latitude);
    console.log("  longitude  : ", longitude);
    console.log("--------------------------------------");
  });
});

 

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.