Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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);
});
});
@KatieK2

This comment has been minimized.

Copy link
Owner Author

KatieK2 commented Sep 11, 2017

This was a demo of code that didn't work as expected. It turns out I needed to initialize the temperature sensor like this:

  var temp = new five.Thermometer({
    controller: "LM35",
    pin: "A3", 
    freq: 1000
  });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.