Skip to content

Commit

Permalink
Gyro Docs breadboard diagram. Closes gh-600
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Feb 2, 2015
1 parent 07f97be commit a3f1c72
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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)
Expand Down
Binary file added docs/breadboard/gyro-lpr5150l.fzz
Binary file not shown.
Binary file added docs/breadboard/gyro-lpr5150l.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions docs/gyro-lpr5150l.md
@@ -0,0 +1,50 @@
<!--remove-start-->
# Gyro Lpr5150l

Run with:
```bash
node eg/gyro-lpr5150l.js
```
<!--remove-end-->

```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)




<!--remove-start-->
## License
Copyright (c) 2012, 2013, 2014 Rick Waldron <waldron.rick@gmail.com>
Licensed under the MIT license.
Copyright (c) 2014, 2015 The Johnny-Five Contributors
Licensed under the MIT license.
<!--remove-end-->
20 changes: 20 additions & 0 deletions 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("--------------------------------------");
});
});
1 change: 1 addition & 0 deletions programs.json
Expand Up @@ -191,6 +191,7 @@
"accelerometer-mpu6050.js",
"accelerometer-pan-tilt.js",
"gyro.js",
"gyro-lpr5150l.js",
"gyro-mpu6050.js",
"photoresistor.js",
"photoresistor-servo.js",
Expand Down

0 comments on commit a3f1c72

Please sign in to comment.