diff --git a/README.md b/README.md index 690572bdb..9d159d41c 100644 --- a/README.md +++ b/README.md @@ -289,6 +289,7 @@ board.on("ready", function() { - [Accelerometer Mpu6050](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-mpu6050.md) - [Accelerometer Pan Tilt](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-pan-tilt.md) - [Gyro](https://github.com/rwaldron/johnny-five/blob/master/docs/gyro.md) +- [Gyro Lpr5150l](https://github.com/rwaldron/johnny-five/blob/master/docs/gyro-lpr5150l.md) - [Gyro Mpu6050](https://github.com/rwaldron/johnny-five/blob/master/docs/gyro-mpu6050.md) - [Photoresistor](https://github.com/rwaldron/johnny-five/blob/master/docs/photoresistor.md) - [Photoresistor Servo](https://github.com/rwaldron/johnny-five/blob/master/docs/photoresistor-servo.md) diff --git a/docs/breadboard/gyro-lpr5150l.fzz b/docs/breadboard/gyro-lpr5150l.fzz new file mode 100644 index 000000000..db6318b3d Binary files /dev/null and b/docs/breadboard/gyro-lpr5150l.fzz differ diff --git a/docs/breadboard/gyro-lpr5150l.png b/docs/breadboard/gyro-lpr5150l.png new file mode 100644 index 000000000..ede7463fe Binary files /dev/null and b/docs/breadboard/gyro-lpr5150l.png differ diff --git a/docs/gyro-lpr5150l.md b/docs/gyro-lpr5150l.md new file mode 100644 index 000000000..3681f1195 --- /dev/null +++ b/docs/gyro-lpr5150l.md @@ -0,0 +1,50 @@ + +# Gyro Lpr5150l + +Run with: +```bash +node eg/gyro-lpr5150l.js +``` + + +```javascript +var five = require("johnny-five"); +var board = new five.Board(); + +board.on("ready", function() { + var gyro = new five.Gyro({ + pins: ["A0", "A1"] + }); + + gyro.on("change", function() { + console.log("gyro"); + console.log(" x : ", this.x); + console.log(" y : ", this.y); + 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("--------------------------------------"); + }); +}); + +``` + + +## Breadboard/Illustration + + +![docs/breadboard/gyro-lpr5150l.png](breadboard/gyro-lpr5150l.png) +[docs/breadboard/gyro-lpr5150l.fzz](breadboard/gyro-lpr5150l.fzz) + + + + + +## License +Copyright (c) 2012, 2013, 2014 Rick Waldron +Licensed under the MIT license. +Copyright (c) 2014, 2015 The Johnny-Five Contributors +Licensed under the MIT license. + diff --git a/eg/gyro-lpr5150l.js b/eg/gyro-lpr5150l.js new file mode 100644 index 000000000..f58bf9350 --- /dev/null +++ b/eg/gyro-lpr5150l.js @@ -0,0 +1,20 @@ +var five = require("../lib/johnny-five.js"); +var board = new five.Board(); + +board.on("ready", function() { + var gyro = new five.Gyro({ + pins: ["A0", "A1"] + }); + + gyro.on("change", function() { + console.log("gyro"); + console.log(" x : ", this.x); + console.log(" y : ", this.y); + 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("--------------------------------------"); + }); +}); diff --git a/programs.json b/programs.json index 182408d8b..1183d0b7e 100644 --- a/programs.json +++ b/programs.json @@ -191,6 +191,7 @@ "accelerometer-mpu6050.js", "accelerometer-pan-tilt.js", "gyro.js", + "gyro-lpr5150l.js", "gyro-mpu6050.js", "photoresistor.js", "photoresistor-servo.js",