servo-blaster.js
Version:
NodeJS library for the ServoBlaster daemon
40 lines (22 loc) • 1.2 kB
Markdown
for the ServoBlaster daemon
Make sure you have `node` and `npm` installed on your Raspberry Pi.
Install the ServiBlaster daemon (https://github.com/richardghirst/PiBits/tree/master/ServoBlaster).
And you want to make sure servod is already running with --max=100% --min=0%
FYI, this is the command I typically start my servod
servod --p1pins=11,29,31,33,35 --max=100% --min=0%
This will give you access to GPIO17/5/6/13/19, and allow you change PWM from 0-100%, instead by 0-12% by default.
Finally install `servo-blaster.js`:
npm install servo-blaster.js
var sb = require('servo-blaster.js');
sb.setP1Pwm(11, 1 );
sb.setP1Pwm(29, 0.2 );
sb.setP1Pwm(29, 0 );
* [Thomas Sarlandie](https://github.com/sarfata) He wrote the original pi-blaster.js and xinkai steal some code from there.
* [Xinkai Wang](https://github.com/xinkaiwang)
Copyright 2016 - Xinkai Wang. Published under the MIT open source license (see full license in LICENSE.txt file).
[servoBlaster]: https://github.com/xinkaiwang/ServoBlaster.js
NodeJS library