JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q32081F
  • License MIT

BlendMicro Node Lib

Package Exports

  • blendmicro

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (blendmicro) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

BlendMicro npm

Node.js module for BlendMicro with BLE.

Node.js <---(BLE)---> BlendMicro

sites

Install

% npm install blendmicro

Samples

see samples directory.

Usage

Open

blendmicro side

#include <SPI.h>
#include <boards.h>
#include <RBL_nRF8001.h>

void setup(){
  ble_set_name("BlendMicro");
  ble_begin();
}

node.js side

var BlendMicro = require('blendmicro');

// search device with BLE peripheral name
var bm = new BlendMicro("BlendMicro");

// search with deefault name "BlendMicro"
var bm = new BlendMicro();

Read

bm.on('open', function(){
  console.log("open!!");

  bm.on("data", function(data){
    console.log(data.toString());
  });
});

Write

bm.write("hello");

bm.write( new Buffer([1,2,3]) );

Close

bm.close(function(){
  console.log("closed");
});

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request