Created
August 17, 2019 16:59
-
-
Save dtex/90493eba74d7c67030e3ba0a586a1b7a to your computer and use it in GitHub Desktop.
Update GPS example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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