node-pololumaestro
This module allows control of the Pololu Maestro range of servo controllers from Node.js allowing your project to interact with the world!
See the API documentation for more information.
Dependencies
This module requires node-serialport in order to communicate with the Maestro, this should be installed automatically.
It also uses Winston for logging.
Installation
Install this module with
npm install pololumaestro
Hacking
Run unit tests with:
npm test
A coverage report should then be available in coverage/lcov-report/index.html
Please submit tests along with new functionality
Usage
Here's a minimal example of how to use the module
var PololuMaestro = ; //create new instance, specifying control com port and optionally the baud ratevar maestro = "COM17" 115200; maestro; //wait until connection is readymaestro; // alternatively, attempt to auto-detect:PololuMaestro;
Version history
v3.0.0
- Breaking change - the callback for PololuMaestro#find now takes arguments
error, maestro
to be more inline with node conventions - Not finding a Maestro no longer causes the process to exit, instead test for the error argument to PololuMaestro#find
v2.1.2
- Small tweak for OS X Mavericks compatibility
v2.1.1
Updates (contributed by achingbrain):
- Adds a find method to attempt to auto-detect a connected board
v2.1.0
Updates (contributed by achingbrain):
- Adds support for USB Dual Port mode
- Adds generated documentation
v2.0.0
Updates (contributed by achingbrain):
- Refactored to implement full compact protocol
- Added unit testing suite
v1.1.0
- Removed serialport v1.06 dependency to be compatible with node v0.10.x (Thanks achingbrain!)
- Added a "ready" event to prevent calls to setPWM being made before the serial port is open
Upgrading
N.b. v2.0.0 breaks compatibilty with v1.1.0. To fix up your code, change the setPWM method to setTarget.
So where you were previously setting the target of channel 0 like this:
maestro;
You should now use:
maestro;