Skip to content

Instantly share code, notes, and snippets.

@dtex
Created August 17, 2019 16:59
Show Gist options
  • Save dtex/90493eba74d7c67030e3ba0a586a1b7a to your computer and use it in GitHub Desktop.
Save dtex/90493eba74d7c67030e3ba0a586a1b7a to your computer and use it in GitHub Desktop.
Update GPS example
const {Board, GPS} = require("../lib/johnny-five.js");
const board = new Board();
board.on("ready", function() {
/*
* 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,
}
});
gps.on("change", position => {
console.log("position");
console.log(" latitude : ", position.latitude);
console.log(" longitude : ", position.longitude);
console.log("--------------------------------------");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment