cylon-i2c
Version:
Cylon.js drivers for i2c devices
20 lines (15 loc) • 405 B
JavaScript
;
var Cylon = require("cylon");
Cylon
.robot()
.connection("arduino", { adaptor: "firmata", port: "/dev/tty.usbmodem1421" })
.device("gyro", { driver: "lsm9ds0g" })
.on("ready", function(bot) {
setInterval(function() {
bot.gyro.getGyro(function(err, data) {
if (err) { console.error(err); }
console.log(data);
});
}, 1000);
});
Cylon.start();