-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Motion: Support for GP2Y0D810Z0F & GP2Y0D815Z0F
- Loading branch information
Showing
13 changed files
with
372 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# Motion - GP2Y0D805Z0F | ||
|
||
|
||
Basic GP2Y0D805Z0F detection. | ||
Basic GP2Y0D805Z0F motion detection. | ||
|
||
|
||
Run with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!--remove-start--> | ||
|
||
# Motion - GP2Y0D810Z0F | ||
|
||
|
||
|
||
Run with: | ||
```bash | ||
node eg/motion-gp2y0d810z0f.js | ||
``` | ||
|
||
<!--remove-end--> | ||
|
||
```javascript | ||
var five = require("johnny-five"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
|
||
// Create a new `motion` hardware instance. | ||
var motion = new five.Motion({ | ||
controller: "GP2Y0D810Z0F", | ||
pin: "A0" | ||
}); | ||
|
||
// "calibrated" occurs once, at the beginning of a session, | ||
motion.on("calibrated", function() { | ||
console.log("calibrated"); | ||
}); | ||
|
||
// "motionstart" events are fired when the "calibrated" | ||
// proximal area is disrupted, generally by some form of movement | ||
motion.on("motionstart", function() { | ||
console.log("motionstart"); | ||
}); | ||
|
||
// "motionend" events are fired following a "motionstart" event | ||
// when no movement has occurred in X ms | ||
motion.on("motionend", function() { | ||
console.log("motionend"); | ||
}); | ||
}); | ||
|
||
``` | ||
|
||
|
||
## Illustrations / Photos | ||
|
||
|
||
### Motion - GP2Y0D810Z0F | ||
|
||
|
||
Basic GP2Y0D810Z0F motion detection. | ||
|
||
|
||
![docs/breadboard/GP2Y0D810Z0F.png](breadboard/GP2Y0D810Z0F.png)<br> | ||
|
||
Fritzing diagram: [docs/breadboard/GP2Y0D810Z0F.fzz](breadboard/GP2Y0D810Z0F.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--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!--remove-start--> | ||
|
||
# Motion - GP2Y0D810Z0F | ||
|
||
|
||
|
||
Run with: | ||
```bash | ||
node eg/motion-gp2y0d815z0f.js | ||
``` | ||
|
||
<!--remove-end--> | ||
|
||
```javascript | ||
var five = require("johnny-five"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
|
||
// Create a new `motion` hardware instance. | ||
var motion = new five.Motion({ | ||
controller: "GP2Y0D810Z0F", | ||
pin: "A0" | ||
}); | ||
|
||
// "calibrated" occurs once, at the beginning of a session, | ||
motion.on("calibrated", function() { | ||
console.log("calibrated"); | ||
}); | ||
|
||
// "motionstart" events are fired when the "calibrated" | ||
// proximal area is disrupted, generally by some form of movement | ||
motion.on("motionstart", function() { | ||
console.log("motionstart"); | ||
}); | ||
|
||
// "motionend" events are fired following a "motionstart" event | ||
// when no movement has occurred in X ms | ||
motion.on("motionend", function() { | ||
console.log("motionend"); | ||
}); | ||
}); | ||
|
||
``` | ||
|
||
|
||
## Illustrations / Photos | ||
|
||
|
||
### Motion - GP2Y0D815Z0F | ||
|
||
|
||
Basic GP2Y0D815Z0F motion detection. | ||
|
||
|
||
![docs/breadboard/GP2Y0D810Z0F.png](breadboard/GP2Y0D810Z0F.png)<br> | ||
|
||
Fritzing diagram: [docs/breadboard/GP2Y0D810Z0F.fzz](breadboard/GP2Y0D810Z0F.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--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var five = require("../lib/johnny-five.js"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
|
||
// Create a new `motion` hardware instance. | ||
var motion = new five.Motion({ | ||
controller: "GP2Y0D810Z0F", | ||
pin: "A0" | ||
}); | ||
|
||
// "calibrated" occurs once, at the beginning of a session, | ||
motion.on("calibrated", function() { | ||
console.log("calibrated"); | ||
}); | ||
|
||
// "motionstart" events are fired when the "calibrated" | ||
// proximal area is disrupted, generally by some form of movement | ||
motion.on("motionstart", function() { | ||
console.log("motionstart"); | ||
}); | ||
|
||
// "motionend" events are fired following a "motionstart" event | ||
// when no movement has occurred in X ms | ||
motion.on("motionend", function() { | ||
console.log("motionend"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var five = require("../lib/johnny-five.js"); | ||
var board = new five.Board(); | ||
|
||
board.on("ready", function() { | ||
|
||
// Create a new `motion` hardware instance. | ||
var motion = new five.Motion({ | ||
controller: "GP2Y0D810Z0F", | ||
pin: "A0" | ||
}); | ||
|
||
// "calibrated" occurs once, at the beginning of a session, | ||
motion.on("calibrated", function() { | ||
console.log("calibrated"); | ||
}); | ||
|
||
// "motionstart" events are fired when the "calibrated" | ||
// proximal area is disrupted, generally by some form of movement | ||
motion.on("motionstart", function() { | ||
console.log("motionstart"); | ||
}); | ||
|
||
// "motionend" events are fired following a "motionstart" event | ||
// when no movement has occurred in X ms | ||
motion.on("motionend", function() { | ||
console.log("motionend"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.