Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updates to various markdown files and examples

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information...
commit d11db77b6cc4c740123b4e06542c36e15d70b5e1 1 parent 5976a43
@rwaldron authored
View
2  README.md
@@ -27,7 +27,7 @@
## Setup and Assemble Arduino
-- Recommended Starting Kit: [Sparkfun Inventor's Kit](https://www.sparkfun.com/products/11022)
+- Recommended Starting Kit: [Sparkfun Inventor's Kit](https://www.sparkfun.com/products/11236)
- Download Arduino IDE
- [OSX](http://arduino.googlecode.com/files/arduino-1.0-macosx.zip)
- [Linux 32 bit](http://arduino.googlecode.com/files/arduino-1.0-linux.tgz)
View
19 awesome.md
@@ -1,20 +1,26 @@
# Awesome Nodebots Built with Johnny-Five
----------------
-## Irene Ros [@ireneros](http://twitter/ireneros)
+## Kelly Korevec [@korevec](http://twitter.com/korevec)
+
+- Medibot
+ [Picture](https://twitter.com/korevec/status/267848987711766528/photo/1)
+ [code](https://github.com/korevec/medibot)
+
+## Irene Ros [@ireneros](http://twitter.com/ireneros)
- Wii Nunchuk Controller for AR Drone (nodecopter event)
[video](http://twitter.yfrog.com/n4u1nrxrakmkyopxxpjmxzmzz)
[code](https://github.com/iros/nodecoptering)
-## Chris Williams [@voodootikigod](http://twitter/voodootikigod)
+## Chris Williams [@voodootikigod](http://twitter.com/voodootikigod)
- Wii Nunchuk Controller for AR Drone (nodecopter event)
[code](https://github.com/voodootikigod/wii-drone/)
-## Andreas Haugstrup Pedersen [@hgstrp](http://twitter/hgstrp)
+## Andreas Haugstrup Pedersen [@hgstrp](http://twitter.com/hgstrp)
- LCD Controller (First successful implementation!!)
[video](http://vimeo.com/46577266)
@@ -22,13 +28,16 @@
(Became the basis for the LCD constructor!)
-## Rebecca Murphey [@rmurphey](http://twitter/rmurphey)
+## Rebecca Murphey [@rmurphey](http://twitter.com/rmurphey)
+
+- Johnny-Five Projects
+ [On Github](https://github.com/rmurphey/johnny-five-projects)
- Shift Register Implementation w/ Led Counter Display
[video](http://vimeo.com/46463390)
[code](http://gist.github.com/3185390)
-## Jonathan Blanchet [@jblanchefr](http://twitter/jblanchefr)
+## Jonathan Blanchet [@jblanchefr](http://twitter.com/jblanchefr)
- Arduino + Websockets + particles:
[video](http://www.youtube.com/watch?v=MXEGLGmpCfo)
View
46 docs/gripper.md
@@ -8,23 +8,48 @@ node eg/gripper.js
```javascript
var five = require("johnny-five"),
- gripper;
+ compulsive = require("compulsive"),
+ wrist, gripper, motion, repeater;
(new five.Board()).on("ready", function() {
// Create a new `gripper` hardware instance.
// This example allows the gripper module to
// create a completely default instance
- gripper = new five.Gripper(9);
+
+ wrist = new five.Servo(9);
+ gripper = new five.Gripper(10);
+
+
+ function slice() {
+ wrist.move(100);
+
+ compulsive.wait(100, function() {
+ wrist.move(120);
+ });
+ }
+ function chop() {
+ compulsive.loop(200, function( loop ) {
+ if ( !repeater ) {
+ repeater = loop;
+ }
+ slice();
+ });
+ }
// Inject the `gripper` hardware into
// the Repl instance's context;
// allows direct command line access
this.repl.inject({
- g: gripper
+ w: wrist,
+ g: gripper,
+ chop: chop,
+ slice: slice
});
+ motion = new five.IR.Motion(7);
+
// gripper.open()
//
// gripper.close()
@@ -33,6 +58,21 @@ var five = require("johnny-five"),
//
//
// g.*() from REPL
+ //
+ //
+ motion.on("motionstart", function( err, ts ) {
+ chop();
+ });
+
+ // "motionstart" events are fired following a "motionstart event
+ // when no movement has occurred in X ms
+ motion.on("motionend", function( err, ts ) {
+ if ( repeater ) {
+ repeater.stop();
+ repeater = null;
+ }
+ });
+
});
View
9 docs/sensor-slider.md
@@ -15,10 +15,7 @@ board = new five.Board();
board.on("ready", function() {
// Create a new `slider` hardware instance.
- slider = new five.Sensor({
- pin: "A0",
- freq: 250
- });
+ slider = new five.Sensor("A2");
// Inject the `slider` hardware into
// the Repl instance's context;
@@ -32,9 +29,9 @@ board.on("ready", function() {
//
// Fires when value of sensor changes
//
- slider.scale([ 0, 100 ]).on("slide", function( err, value ) {
+ slider.scale([ 0, 100 ]).on("slide", function() {
- console.log( "slide", value, this.value, this.scaled );
+ console.log( "slide", this.value, this.scaled );
});
});
View
46 eg/gripper.js
@@ -1,21 +1,46 @@
var five = require("../lib/johnny-five.js"),
- gripper;
+ compulsive = require("compulsive"),
+ wrist, gripper, motion, repeater;
(new five.Board()).on("ready", function() {
// Create a new `gripper` hardware instance.
// This example allows the gripper module to
// create a completely default instance
- gripper = new five.Gripper(9);
+
+ wrist = new five.Servo(9);
+ gripper = new five.Gripper(10);
+
+
+ function slice() {
+ wrist.move(100);
+
+ compulsive.wait(100, function() {
+ wrist.move(120);
+ });
+ }
+ function chop() {
+ compulsive.loop(200, function( loop ) {
+ if ( !repeater ) {
+ repeater = loop;
+ }
+ slice();
+ });
+ }
// Inject the `gripper` hardware into
// the Repl instance's context;
// allows direct command line access
this.repl.inject({
- g: gripper
+ w: wrist,
+ g: gripper,
+ chop: chop,
+ slice: slice
});
+ motion = new five.IR.Motion(7);
+
// gripper.open()
//
// gripper.close()
@@ -24,6 +49,21 @@ var five = require("../lib/johnny-five.js"),
//
//
// g.*() from REPL
+ //
+ //
+ motion.on("motionstart", function( err, ts ) {
+ chop();
+ });
+
+ // "motionstart" events are fired following a "motionstart event
+ // when no movement has occurred in X ms
+ motion.on("motionend", function( err, ts ) {
+ if ( repeater ) {
+ repeater.stop();
+ repeater = null;
+ }
+ });
+
});
View
9 eg/sensor-slider.js
@@ -6,10 +6,7 @@ board = new five.Board();
board.on("ready", function() {
// Create a new `slider` hardware instance.
- slider = new five.Sensor({
- pin: "A0",
- freq: 250
- });
+ slider = new five.Sensor("A2");
// Inject the `slider` hardware into
// the Repl instance's context;
@@ -23,9 +20,9 @@ board.on("ready", function() {
//
// Fires when value of sensor changes
//
- slider.scale([ 0, 100 ]).on("slide", function( err, value ) {
+ slider.scale([ 0, 100 ]).on("slide", function() {
- console.log( "slide", value, this.value, this.scaled );
+ console.log( "slide", this.value, this.scaled );
});
});
View
8 package.json
@@ -29,14 +29,12 @@
},
"dependencies": {
"colors": ">=0.5.1",
- "grunt": "~0.3.9",
"firmata": ">=0.2.0",
"lodash": ">=0.1.0",
"es6-collections": ">=0.0.1",
"socket.io": "latest",
- "when": "~1.3.0",
"compulsive": "latest",
- "tobinary": "latest"
+ "descriptor": "latest"
},
"devDependencies": {
"nodeunit": ">=0.7.4",
@@ -46,9 +44,7 @@
"lodash": ">=0.1.0",
"es6-collections": ">=0.0.1",
"socket.io": "latest",
- "when": "~1.3.0",
- "compulsive": "latest",
- "tobinary": "latest"
+ "compulsive": "latest"
},
"keywords": []
}
Please sign in to comment.
Something went wrong with that request. Please try again.