shokai / blendmicro-node Goto Github PK
View Code? Open in Web Editor NEWNode.js module for BlendMicro/BLENano with BLE
Home Page: https://www.npmjs.org/package/blendmicro
License: MIT License
Node.js module for BlendMicro/BLENano with BLE
Home Page: https://www.npmjs.org/package/blendmicro
License: MIT License
#include <SPI.h>
#include <boards.h>
#include <RBL_nRF8001.h>
void setup()
{
ble_set_name("MyBlendMicro"); // not work
ble_begin();
}
BLE has limit its packet size 20byte. and 30msec interval required.
BlendMicro.write
function should have a Queue and split 20byte to send message.
var devices = ["BlendMicro", "Blend2"];
devices.map(function(device_name){
return new BlendMicro(device_name);
}).forEach(function(bm){
bm.on("data", function(data){
console.log(data.toString() + " - from " + bm.name);
});
setInterval(function(){
bm.write(new Date().toString());
}, 1000);
});
each devices running samples/echo/echo.ino
each BlendMicro instance has same noble
object. So when A has connected, it calls noble.stopScanning()
and disturb B.
close: (callback) ->
ble.noble.removeAllListeners()
@peripheral.removeAllListeners()
@peripheral.disconnect =>
callback?()
@emit 'close'
@peripheral = null
translate BlendMicro code for BLENano
BlendMicro = require 'blendmicro'
bm = new BlendMicro()
bm.on 'connect', ->
setInterval ->
console.log bm.rssi
, 1000
Hi! I'm using the "echo.js" example with a Blend Micro board.
Sometimes it happens to me that the connection close after 20-30 seconds. I have to stop the echo.js (via CTRL+C) and restart it via $node echo.js
and it start again.
On Arduino side I have this message error:
data transmmit success! Length: 15 Data Credit available: 1
Evt Disconnected/Advertising timed out
Advertising started
How to reconnect it automatically?
add blendmicro
command
% blendmicro -list
% blendmicro -terminal (device_name)
cannot reconnect on close
Hello! I use the adc_read sketch and bm.write('Hello'). On blend micro i use Simple sketch from library rBL_nRF8001. Blend micro send data to node, node read data. bm.write not send data
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.