-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbmp180.js
44 lines (36 loc) · 1.37 KB
/
bmp180.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// var five = require("johnny-five");
// var board = new five.Board();
// board.on("ready", function() {
// var multi = new five.Multi({
// controller: "BMP180"
// });
// multi.on("change", function() {
// console.log("thermometer");
// console.log(" celsius : ", this.thermometer.celsius);
// console.log(" fahrenheit : ", this.thermometer.fahrenheit);
// console.log(" kelvin : ", this.thermometer.kelvin);
// console.log("--------------------------------------");
// console.log("barometer");
// console.log(" pressure : ", this.barometer.pressure);
// console.log("--------------------------------------");
// console.log("altimeter");
// console.log(" feet : ", this.altimeter.feet);
// console.log(" meters : ", this.altimeter.meters);
// console.log("--------------------------------------");
// });
// });
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
var temperature = new five.Thermometer({
controller: "BMP180",
freq: 250
});
temperature.on("change", function() {
console.log("temperature");
console.log(" celsius : ", this.celsius);
console.log(" fahrenheit : ", this.fahrenheit);
console.log(" kelvin : ", this.kelvin);
console.log("--------------------------------------");
});
});