johnny-five-electron
Version:
Temporary fork to support Electron (to be deprecated)
22 lines (19 loc) • 687 B
JavaScript
var five = require("../lib/johnny-five.js");
var board = new five.Board();
board.on("ready", function() {
var gyro = new five.Gyro({
controller: "MPU6050"
});
gyro.on("change", function() {
console.log("gyro");
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(" yaw : ", this.yaw);
console.log(" rate : ", this.rate);
console.log(" isCalibrated : ", this.isCalibrated);
console.log("--------------------------------------");
});
});