Created
March 4, 2017 21:19
-
-
Save KatieK2/3fa9ef18cc634a0660626bacd8ca74ac to your computer and use it in GitHub Desktop.
This file contains 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
var five = require("johnny-five"); | |
var board = new five.Board(); | |
// !! Seems to read too high a temp. | |
board.on("ready", function(){ | |
// Create an analog Thermometer object: | |
var temp = new five.Thermometer({ | |
pin: "A3", | |
freq: 1000 | |
}); | |
temp.on("data", function() { | |
console.log("celsius: %d", this.C); | |
console.log("fahrenheit: %d", this.F); | |
console.log("kelvin: %d", this.K); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was a demo of code that didn't work as expected. It turns out I needed to initialize the temperature sensor like this: