1.0.1 • Published 7 years ago

mbed-js-chainableled v1.0.1

Weekly downloads
8
License
-
Repository
-
Last release
7 years ago

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

  1. In your Gulp-based mbed.js project, run:

    $ npm install mbed-js-chainableled --save
  2. Go into the chainableled folder and install the native library:

    $ cd node_modules/mbed-js-chainableled
    $ mbed add $(cat ChainableLED.lib)
    $ cd ../..
  3. Clear your build directory:

    $ rm -r build/out
  4. 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);