BlendMicro npm
Node.js module for BlendMicro with BLE.
Node.js <---(BLE)---> BlendMicro
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');
var bm = new BlendMicro("BlendMicro");
var bm = new BlendMicro();
Read/Write
bm.on('open', function(){
console.log("open!!");
bm.on("data", function(data){
console.log(data.toString());
});
setInterval(function(){
bm.write("hello");
});
});
Close
bm.close(function(){
console.log("closed");
});
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request