mbed-js-chainableled
v1.0.1
Published
ChainableLED wrapper for JS on mbed
Downloads
4
Readme
mbed.js wrapper for ChainableLED
JS on mbed driver for the Grove ChainableLED, based on Jackson_lv/ChainableLED.
This wrapper was generated via mbed-js-wrapper-generator.
Usage
In your Gulp-based mbed.js project, run:
$ npm install mbed-js-chainableled --save
Go into the chainableled folder and install the native library:
$ cd node_modules/mbed-js-chainableled $ mbed add $(cat ChainableLED.lib) $ cd ../..
Clear your build directory:
$ rm -r build/out
Use the library via:
var led = ChainableLED(D5, D6, 1); var ix = 0; setInterval(function() { if (++ix % 2 == 1) { led.setColorRGB(0, 255, 0, 0); } else { led.setColorRGB(0, 0, 255, 0); } }, 1000);