Comparar commits
7 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| b24d682e49 | |||
| b36a7b3409 | |||
| cfa8f4bdc8 | |||
| ee66c49ff0 | |||
| abfb37a38e | |||
| 48be1a01db | |||
| 8bbc011ead |
@@ -1,7 +1,12 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "4.0"
|
||||
- "4.1"
|
||||
- "4.2"
|
||||
- "5.11.0"
|
||||
- "6.0"
|
||||
- "6.1"
|
||||
- "6.2"
|
||||
install:
|
||||
- npm install --all
|
||||
script:
|
||||
|
||||
+22
-11
@@ -22,7 +22,8 @@ npm install openbci-sdk
|
||||
#### Get connected and start streaming
|
||||
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.connect(portName)
|
||||
.then(function() {
|
||||
ourBoard.on('ready',function() {
|
||||
@@ -67,7 +68,8 @@ var ourBoard = new OpenBCIBoard.OpenBCIBoard();
|
||||
For initializing with options, such as verbose print outs:
|
||||
|
||||
```js
|
||||
var ourBoard = require('openbci-sdk').OpenBCIBoard({
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard({
|
||||
verbose: true
|
||||
});
|
||||
```
|
||||
@@ -75,7 +77,8 @@ var ourBoard = require('openbci-sdk').OpenBCIBoard({
|
||||
Or if you don't have a board and want to use synthetic data:
|
||||
|
||||
```js
|
||||
var ourBoard = require('openbci-sdk').OpenBCIBoard({
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard({
|
||||
simulate: true
|
||||
});
|
||||
```
|
||||
@@ -103,7 +106,8 @@ You MUST wait for the 'ready' event to be emitted before streaming/talking with
|
||||
so installing the 'sample' listener and writing before the ready event might result in... nothing at all.
|
||||
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.connect(portName).then(function(boardSerial) {
|
||||
ourBoard.on('ready',function() {
|
||||
/** Start streaming, reading registers, what ever your heart desires */
|
||||
@@ -132,7 +136,8 @@ To get a 'sample' event, you need to:
|
||||
3. In callback for 'ready' emitter, call `streamStart()`
|
||||
4. Install the 'sample' event emitter
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.connect(portName).then(function() {
|
||||
ourBoard.on('ready',function() {
|
||||
ourBoard.streamStart();
|
||||
@@ -157,7 +162,8 @@ You must have the OpenBCI board connected to the PC before trying to automatical
|
||||
If a port is not automatically found, then call `.listPorts()` to get a list of all serial ports this would be a good place to present a drop down picker list to the user, so they may manually select the serial port name.
|
||||
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.autoFindOpenBCIBoard().then(portName => {
|
||||
if(portName) {
|
||||
/**
|
||||
@@ -198,7 +204,8 @@ Where there are the same number of elements as channels and each element can be
|
||||
|
||||
Without further ado, here is an example:
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.connect(portName).then(function(boardSerial) {
|
||||
ourBoard.on('ready',function() {
|
||||
ourBoard.streamStart();
|
||||
@@ -254,7 +261,8 @@ To run an impedance test on all inputs, one channel at a time:
|
||||
For example:
|
||||
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.connect(portName).then(function(boardSerial) {
|
||||
ourBoard.streamStart();
|
||||
ourBoard.on('impedanceArray', impedanceArray => {
|
||||
@@ -436,7 +444,8 @@ A Number, specifies which channel you want to test.
|
||||
|
||||
Example:
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.connect(portName).then(function(boardSerial) {
|
||||
ourBoard.on('ready',function() {
|
||||
ourBoard.streamStart();
|
||||
@@ -477,7 +486,8 @@ A Number, specifies which channel you want to test.
|
||||
|
||||
Example:
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.connect(portName).then(function(boardSerial) {
|
||||
ourBoard.on('ready',function() {
|
||||
ourBoard.streamStart();
|
||||
@@ -518,7 +528,8 @@ A Number, specifies which channel you want to test.
|
||||
|
||||
Example:
|
||||
```js
|
||||
var ourBoard = new require('openbci-sdk').OpenBCIBoard();
|
||||
var OpenBCIBoard = require('openbci-sdk').OpenBCIBoard;
|
||||
var ourBoard = new OpenBCIBoard();
|
||||
ourBoard.connect(portName).then(function(boardSerial) {
|
||||
ourBoard.on('ready',function() {
|
||||
ourBoard.streamStart();
|
||||
|
||||
+12
-1
@@ -1,3 +1,14 @@
|
||||
# 0.3.8
|
||||
|
||||
### Bug Fixes
|
||||
* Fixed readme.md
|
||||
|
||||
# 0.3.7
|
||||
|
||||
### New Features
|
||||
* Upgrade dependencies
|
||||
* Update Travis
|
||||
|
||||
# 0.3.6
|
||||
|
||||
### New Features
|
||||
@@ -81,4 +92,4 @@
|
||||
|
||||
### Github Issues Addressed
|
||||
|
||||
* #25, #26, #27, #29, #30, #31, #33, #34
|
||||
* #25, #26, #27, #29, #30, #31, #33, #34
|
||||
|
||||
+2
-2
@@ -94,7 +94,7 @@ function OpenBCIFactory() {
|
||||
/** Properties (keep alphabetical) */
|
||||
// Arrays
|
||||
this.writeOutArray = new Array(100);
|
||||
this.channelSettingsArray = k.channelSettingsArrayInit(this.numberOfChannels());
|
||||
this.channelSettingsArray = k.channelSettingsArrayInit(k.numberOfChannelsForBoardType(this.options.boardType));
|
||||
// Bools
|
||||
this.isLookingForKeyInBuffer = true;
|
||||
// Buffers
|
||||
@@ -105,7 +105,7 @@ function OpenBCIFactory() {
|
||||
};
|
||||
this.searchingBuf = this.searchBuffers.miscStop;
|
||||
// Objects
|
||||
this.goertzelObject = openBCISample.goertzelNewObject(this.numberOfChannels());
|
||||
this.goertzelObject = openBCISample.goertzelNewObject(k.numberOfChannelsForBoardType(this.options.boardType));
|
||||
this.writer = null;
|
||||
this.impedanceTest = {
|
||||
active: false,
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openbci-sdk",
|
||||
"version": "0.3.6",
|
||||
"version": "0.3.8",
|
||||
"description": "The official Node.js SDK for the OpenBCI Biosensor Board.",
|
||||
"main": "openBCIBoard",
|
||||
"scripts": {
|
||||
@@ -18,7 +18,8 @@
|
||||
"gaussian": "^1.0.0",
|
||||
"istanbul": "^0.4.2",
|
||||
"performance-now": "^0.2.0",
|
||||
"serialport": "~2.1.0",
|
||||
"scientific-statistics": "^0.2.7",
|
||||
"serialport": "3.1.2",
|
||||
"sntp": "^2.0.0"
|
||||
},
|
||||
"directories": {
|
||||
|
||||
@@ -36,6 +36,13 @@ describe('openbci-sdk',function() {
|
||||
})
|
||||
});
|
||||
describe('#constructor', function () {
|
||||
it('constructs with require', function() {
|
||||
var OpenBCIBoard = require('../openBCIBoard').OpenBCIBoard;
|
||||
ourBoard = new OpenBCIBoard({
|
||||
verbose:true
|
||||
});
|
||||
expect(ourBoard.numberOfChannels()).to.equal(8);
|
||||
});
|
||||
it('constructs with the correct default options', function() {
|
||||
ourBoard = new openBCIBoard.OpenBCIBoard();
|
||||
(ourBoard.options.boardType).should.equal('default');
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário