UNPKG

johnny-five

Version:

The JavaScript Robotics and Hardware Programming Framework. Use with: Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, Raspberry Pi, Spark Core, TI Launchpad and more!

19 lines (15 loc) 553 B
var five = require("../lib/johnny-five"); five.Board().on("ready", function() { // This requires OneWire support using the ConfigurableFirmata var temperature = new five.Temperature({ controller: "DS18B20", pin: 2 }); temperature.on("data", function() { console.log(this.celsius + "°C", this.fahrenheit + "°F"); console.log("0x" + this.address.toString(16)); }); }); // @markdown // - [DS18B20 - Temperature Sensor](http://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/DS18S20.html) // @markdown