Permalink
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (45 sloc) 1.38 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
var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {

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

  // If latitude, longitude, course or speed change log it
  gps.on("change", function() {
    console.log("position");
    console.log("  latitude   : ", this.latitude);
    console.log("  longitude  : ", this.longitude);
    console.log("--------------------------------------");
  });
});

 

License

Copyright (c) 2012-2014 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license. Copyright (c) 2015-2018 The Johnny-Five Contributors Licensed under the MIT license.