-
-
Save mcollina/104ec743c95fd5cad64d to your computer and use it in GitHub Desktop.
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
var five = require("johnny-five"), | |
board, sensor; | |
board = new five.Board(); | |
board.on("ready", function() { | |
sensor = new five.Sensor({ pin: 0, freq: 250 }); | |
board.repl.inject({ | |
sensor: sensor | |
}); | |
sensor.on("change", function(err, reading) { | |
var voltage = reading * .004882814; | |
var temperature = ((voltage - .5) * 100); | |
console.log( temperature ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment