Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
75 lines (40 sloc) 1.34 KB

GPS - Hardware Serial

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

Breadboard for "GPS - Hardware Serial"


Fritzing diagram: docs/breadboard/gps-hardware-serial.fzz


Run this example from the command line with:

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

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

   * Explicitly setting HW_SERIAL1 for the port
  const gps = new GPS({

  // 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);



Copyright (c) 2012-2014 Rick Waldron Licensed under the MIT license. Copyright (c) 2015-2019 The Johnny-Five Contributors Licensed under the MIT license.

You can’t perform that action at this time.