Permalink
Browse files

Rebuild all example program markdown files

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information...
1 parent 462ec64 commit 6b5ab5b6950342f50209abb7e7d2036a80c925e3 @rwaldron committed Jul 2, 2012
Showing with 5,957 additions and 2 deletions.
  1. +2 −2 README.md
  2. +80 −0 docs/accelerometer-pan-tilt.md
  3. +84 −0 docs/accelerometer.md
  4. +63 −0 docs/board-multi.md
  5. +72 −0 docs/board.md
  6. +283 −0 docs/boe-test-servos.md
  7. +81 −0 docs/button-options.md
  8. +79 −0 docs/button.md
  9. +76 −0 docs/claw.md
  10. +81 −0 docs/continuous-clock.md
  11. +72 −0 docs/continuous.md
  12. +135 −0 docs/hmc5883l.md
  13. +99 −0 docs/ir.md
  14. +66 −0 docs/joystick-claw.md
  15. +79 −0 docs/joystick-laser.md
  16. +109 −0 docs/joystick-motor-led.md
  17. +97 −0 docs/joystick.md
  18. +52 −0 docs/laser.md
  19. +59 −0 docs/lcd.md
  20. +80 −0 docs/led-fade.md
  21. +66 −0 docs/led-on-off.md
  22. +76 −0 docs/led-pulse.md
  23. +56 −0 docs/led-rgb.md
  24. +54 −0 docs/led-strobe.md
  25. +146 −0 docs/magnetometer-log.md
  26. +150 −0 docs/magnetometer-north.md
  27. +108 −0 docs/magnetometer.md
  28. +89 −0 docs/motor.md
  29. +108 −0 docs/navigator-joystick.md
  30. +479 −0 docs/navigator-original.md
  31. +526 −0 docs/navigator.md
  32. +65 −0 docs/piezo.md
  33. +82 −0 docs/ping.md
  34. +79 −0 docs/pir.md
  35. +71 −0 docs/potentiometer.md
  36. +90 −0 docs/proximity.md
  37. +309 −0 docs/radar-client.md
  38. +168 −0 docs/radar.md
  39. +49 −0 docs/repl.md
  40. +60 −0 docs/sensor-fsr-servo.md
  41. +63 −0 docs/sensor-fsr.md
  42. +69 −0 docs/sensor-ir-led-receiver.md
  43. +76 −0 docs/sensor-slider.md
  44. +98 −0 docs/sensor.md
  45. +117 −0 docs/servo-array.md
  46. +96 −0 docs/servo-diagnostic.md
  47. +75 −0 docs/servo-digital.md
  48. +75 −0 docs/servo-dual.md
  49. +67 −0 docs/servo-tutorial.md
  50. +112 −0 docs/servo.md
  51. +62 −0 docs/slider-log.md
  52. +68 −0 docs/slider-pan.md
  53. +69 −0 docs/slider-servo-control.md
  54. +59 −0 docs/socket.md
  55. +180 −0 docs/sonar-scan.md
  56. +91 −0 docs/sonar.md
View
@@ -97,19 +97,19 @@ board.on("ready", function() {
- [Led Pulse](https://github.com/rwldrn/johnny-five/blob/master/docs/led-pulse.md)
- [Led Rgb](https://github.com/rwldrn/johnny-five/blob/master/docs/led-rgb.md)
- [Led Strobe](https://github.com/rwldrn/johnny-five/blob/master/docs/led-strobe.md)
+- [Magnetometer Log](https://github.com/rwldrn/johnny-five/blob/master/docs/magnetometer-log.md)
- [Magnetometer North](https://github.com/rwldrn/johnny-five/blob/master/docs/magnetometer-north.md)
-- [Magnetometer Servo](https://github.com/rwldrn/johnny-five/blob/master/docs/magnetometer-servo.md)
- [Magnetometer](https://github.com/rwldrn/johnny-five/blob/master/docs/magnetometer.md)
- [Motor](https://github.com/rwldrn/johnny-five/blob/master/docs/motor.md)
- [Navigator Joystick](https://github.com/rwldrn/johnny-five/blob/master/docs/navigator-joystick.md)
- [Navigator Original](https://github.com/rwldrn/johnny-five/blob/master/docs/navigator-original.md)
- [Navigator](https://github.com/rwldrn/johnny-five/blob/master/docs/navigator.md)
- [Piezo](https://github.com/rwldrn/johnny-five/blob/master/docs/piezo.md)
-- [Ping Radar](https://github.com/rwldrn/johnny-five/blob/master/docs/ping-radar.md)
- [Ping](https://github.com/rwldrn/johnny-five/blob/master/docs/ping.md)
- [Pir](https://github.com/rwldrn/johnny-five/blob/master/docs/pir.md)
- [Potentiometer](https://github.com/rwldrn/johnny-five/blob/master/docs/potentiometer.md)
- [Proximity](https://github.com/rwldrn/johnny-five/blob/master/docs/proximity.md)
+- [Radar Client](https://github.com/rwldrn/johnny-five/blob/master/docs/radar-client.md)
- [Radar](https://github.com/rwldrn/johnny-five/blob/master/docs/radar.md)
- [Repl](https://github.com/rwldrn/johnny-five/blob/master/docs/repl.md)
- [Sensor Fsr Servo](https://github.com/rwldrn/johnny-five/blob/master/docs/sensor-fsr-servo.md)
@@ -0,0 +1,80 @@
+# Accelerometer Pan Tilt
+
+Run with:
+```bash
+node eg/accelerometer-pan-tilt.js
+```
+
+
+```javascript
+var five = require("johnny-five"),
+ board;
+
+board = new five.Board();
+
+board.on("ready", function() {
+
+ var range, pan, tilt, accel;
+
+ range = [ 0, 170 ];
+
+ // Servo to control panning
+ pan = new five.Servo({
+ pin: 9,
+ range: range
+ });
+
+ // Servo to control tilt
+ tilt = new five.Servo({
+ pin: 10,
+ range: range
+ });
+
+ // Accelerometer to control pan/tilt
+ accel = new five.Accelerometer({
+ pins: [ "A3", "A4", "A5" ],
+ freq: 250
+ });
+
+ // Center all servos
+ (five.Servos()).center();
+
+ accel.on("acceleration", function( err, timestamp ) {
+ // console.log( "acceleration", this.axis );
+
+ tilt.move( Math.abs( Math.ceil(170 * this.pitch.toFixed(2)) - 180 ) );
+ pan.move( Math.ceil(170 * this.roll.toFixed(2)) );
+
+ // TODO: Math.abs(v - 180) as inversion function ?
+ });
+});
+
+```
+
+## Breadboard
+
+
+
+
+## Documentation
+
+_(Nothing yet)_
+
+
+
+
+
+
+
+
+
+## Contributing
+All contributions must adhere to the the [Idiomatic.js Style Guide](https://github.com/rwldrn/idiomatic.js),
+by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
+
+## Release History
+_(Nothing yet)_
+
+## License
+Copyright (c) 2012 Rick Waldron <waldron.rick@gmail.com>
+Licensed under the MIT license.
View
@@ -0,0 +1,84 @@
+# Accelerometer
+
+Run with:
+```bash
+node eg/accelerometer.js
+```
+
+
+```javascript
+var five = require("johnny-five"),
+ board, accel;
+
+board = new five.Board();
+
+board.on("ready", function() {
+
+ // Create a new `Accelerometer` hardware instance.
+ //
+ // five.Accelerometer([ x, y[, z] ]);
+ //
+ // five.Accelerometer({
+ // pins: [ x, y[, z] ]
+ // freq: ms
+ // });
+ //
+
+ accel = new five.Accelerometer({
+ pins: [ "A3", "A4", "A5" ],
+ freq: 100
+ });
+
+ // Accelerometer Event API
+
+ // "acceleration"
+ //
+ // Fires once every N ms, equal to value of freg
+ // Defaults to 500ms
+ //
+ accel.on("acceleration", function( err, timestamp ) {
+
+ console.log( "acceleration", this.pitch, this.roll );
+ });
+
+ // "axischange"
+ //
+ // Fires only when X, Y or Z has changed
+ //
+ accel.on("axischange", function( err, timestamp ) {
+
+ console.log( "axischange", this.raw );
+ });
+});
+
+```
+
+## Breadboard
+
+<img src="https://raw.github.com/rwldrn/johnny-five/master/docs/breadboard/accelerometer.png">
+
+[accelerometer.fzz](https://github.com/rwldrn/johnny-five/blob/master/docs/breadboard/accelerometer.fzz)
+
+
+## Documentation
+
+_(Nothing yet)_
+
+
+
+
+
+
+
+
+
+## Contributing
+All contributions must adhere to the the [Idiomatic.js Style Guide](https://github.com/rwldrn/idiomatic.js),
+by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
+
+## Release History
+_(Nothing yet)_
+
+## License
+Copyright (c) 2012 Rick Waldron <waldron.rick@gmail.com>
+Licensed under the MIT license.
View
@@ -0,0 +1,63 @@
+# Board Multi
+
+Run with:
+```bash
+node eg/board-multi.js
+```
+
+
+```javascript
+var five = require("johnny-five"),
+ boards;
+
+boards = [
+ new five.Board({ id: "a" }),
+ new five.Board({ id: "b" })
+];
+
+// Add ready event handlers to both boards.
+boards.forEach(function( board ) {
+ board.on("ready", function() {
+ var val = 0;
+
+ console.log( "ready!!!!!" );
+
+ // Set pin 13 to OUTPUT mode
+ this.pinMode( 13, 1 );
+
+ // Create a loop to "flash/blink/strobe" an led
+ this.loop( 50, function() {
+ this.digitalWrite( 13, (val = val ? 0 : 1) );
+ });
+ });
+});
+
+```
+
+## Breadboard
+
+
+
+
+## Documentation
+
+_(Nothing yet)_
+
+
+
+
+
+
+
+
+
+## Contributing
+All contributions must adhere to the the [Idiomatic.js Style Guide](https://github.com/rwldrn/idiomatic.js),
+by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
+
+## Release History
+_(Nothing yet)_
+
+## License
+Copyright (c) 2012 Rick Waldron <waldron.rick@gmail.com>
+Licensed under the MIT license.
View
@@ -0,0 +1,72 @@
+# Board
+
+Run with:
+```bash
+node eg/board.js
+```
+
+
+```javascript
+var five = require("johnny-five"),
+ board;
+
+board = new five.Board();
+
+// The board's pins will not be accessible until
+// the board has reported that it is ready
+board.on("ready", function() {
+ var val = 0;
+
+ // Set pin 13 to OUTPUT mode
+ this.pinMode( 13, 1 );
+
+ // Mode Table
+ // INPUT: 0
+ // OUTPUT: 1
+ // ANALOG: 2
+ // PWM: 3
+ // SERVO: 4
+
+ // Create a loop to "flash/blink/strobe" an led
+ this.loop( 50, function() {
+
+ this.digitalWrite( 13, (val = val ? 0 : 1) );
+
+ });
+});
+
+
+// Schematic
+// http://arduino.cc/en/uploads/Tutorial/ExampleCircuit_bb.png
+
+```
+
+## Breadboard
+
+<img src="https://raw.github.com/rwldrn/johnny-five/master/docs/breadboard/board.png">
+
+[board.fzz](https://github.com/rwldrn/johnny-five/blob/master/docs/breadboard/board.fzz)
+
+
+## Documentation
+
+_(Nothing yet)_
+
+
+
+
+
+
+
+
+
+## Contributing
+All contributions must adhere to the the [Idiomatic.js Style Guide](https://github.com/rwldrn/idiomatic.js),
+by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
+
+## Release History
+_(Nothing yet)_
+
+## License
+Copyright (c) 2012 Rick Waldron <waldron.rick@gmail.com>
+Licensed under the MIT license.
Oops, something went wrong.

0 comments on commit 6b5ab5b

Please sign in to comment.