UNPKG

johnny-five-electron

Version:

Temporary fork to support Electron (to be deprecated)

22 lines (19 loc) 738 B
var five = require("../lib/johnny-five.js"); var board = new five.Board(); board.on("ready", function() { var accelerometer = new five.Accelerometer({ controller: "ADXL345" }); accelerometer.on("change", function() { console.log("accelerometer"); console.log(" x : ", this.x); console.log(" y : ", this.y); console.log(" z : ", this.z); console.log(" pitch : ", this.pitch); console.log(" roll : ", this.roll); console.log(" acceleration : ", this.acceleration); console.log(" inclination : ", this.inclination); console.log(" orientation : ", this.orientation); console.log("--------------------------------------"); }); });