UNPKG

johnny-five

Version:

Firmata based Arduino Programming Framework.

79 lines (45 loc) 1.48 kB
# Continuous Run with: ```bash node eg/continuous.js ``` ```javascript var five = require("johnny-five"), board, servo; board = new five.Board(); board.on("ready", function() { // Create a new `servo` hardware instance. servo = new five.Servo({ pin: 9, // `type` defaults to standard servo. // For continuous rotation servos, override the default // by setting the `type` here type: "continuous" }); // Inject the `servo` hardware into // the Repl instance's context; // allows direct command line access board.repl.inject({ servo: servo }); // Continuous Rotation Servo API // move( speed ) // Set the speed at which the continuous rotation // servo will rotate at. servo.move( 90 ); }); ``` ## Breadboard/Illustration <img src="https://raw.github.com/rwldrn/johnny-five/master/docs/breadboard/continuous.png"> [docs/breadboard/continuous.fzz](https://github.com/rwldrn/johnny-five/blob/master/docs/breadboard/continuous.fzz) ## Devices ## Documentation _(Nothing yet)_ ## Contributing All contributions must adhere to 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.