Skip to content

Commit 2523f72

Browse files
author
AJ Keller
committed
Update readme for new functions and emitters
1 parent af9f086 commit 2523f72

File tree

2 files changed

+47
-31
lines changed

2 files changed

+47
-31
lines changed

README.md

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Want to know if the module really works? Check out some projects and organizatio
7373

7474
Still not satisfied it works?? Check out this [detailed report](http://s132342840.onlinehome.us/pushtheworld/files/voltageVerificationTestPlanAndResults.pdf) that scientifically validates the output voltages of this module.
7575

76-
How are you still doubting and not using this already? Fine, go look at some of the [700 **_automatic_** tests](https://codecov.io/gh/OpenBCI/OpenBCI_NodeJS) written for it!
76+
How are you still doubting and not using this already? Fine, go look at some of the [800 **_automatic_** tests](https://codecov.io/gh/OpenBCI/OpenBCI_NodeJS) written for it!
7777

7878
Python researcher or developer? Check out how easy it is to [get access to the entire API in the Python example](examples/python)!
7979

@@ -88,6 +88,7 @@ Initializing the board:
8888
var OpenBCIBoard = require('openbci');
8989
var ourBoard = new OpenBCIBoard.OpenBCIBoard();
9090
```
91+
Go [checkout out the get streaming example](examples/getStreaming/getStreaming.js)!
9192

9293
For initializing with options, such as verbose print outs:
9394

@@ -107,6 +108,16 @@ var ourBoard = new OpenBCIBoard({
107108
});
108109
```
109110

111+
Have a daisy?:
112+
```js
113+
var OpenBCIBoard = require('openbci').OpenBCIBoard;
114+
var ourBoard = new OpenBCIBoard({
115+
boardType: `daisy`,
116+
hardSet: true
117+
});
118+
```
119+
Go [checkout out the get streaming with daisy example](examples/getStreamingDaisy/getStreamingDaisy.js)!
120+
110121
Another useful way to start the simulator:
111122
```js
112123
var openBCIBoard = require('openbci');
@@ -130,7 +141,7 @@ var ourBoard = new OpenBCIBoard({
130141
simulate: true
131142
});
132143
```
133-
ps: go [checkout out the example](examples/debug/debug.js) to do it right now!
144+
Go [checkout out the debug example](examples/debug/debug.js)!
134145

135146
'ready' event
136147
------------
@@ -395,6 +406,7 @@ Board optional configurations.
395406
* `daisy` - 8 Channel board with Daisy Module - 16 Channels
396407
* `ganglion` - 4 Channel board
397408
(NOTE: THIS IS IN-OP TIL RELEASE OF GANGLION BOARD 08/2016)
409+
* `hardSet` {Boolean} - Recommended if using `daisy` board! For some reason, the `daisy` is sometimes not picked up by the module so you can set `hardSet` to true which will ensure the daisy is picked up. (Default `false`)
398410
* `simulate` {Boolean} - Full functionality, just mock data. Must attach Daisy module by setting `simulatorDaisyModuleAttached` to `true` in order to get 16 channels. (Default `false`)
399411
* `simulatorBoardFailure` {Boolean} - Simulates board communications failure. This occurs when the RFduino on the board is not polling the RFduino on the dongle. (Default `false`)
400412
* `simulatorDaisyModuleAttached` {Boolean} - Simulates a daisy module being attached to the OpenBCI board. This is useful if you want to test how your application reacts to a user requesting 16 channels but there is no daisy module actually attached, or vice versa, where there is a daisy module attached and the user only wants to use 8 channels. (Default `false`)
@@ -532,6 +544,21 @@ A number specifying which channel you want to get data on. Only 1-8 at this time
532544
533545
**_Returns_** a promise, fulfilled if the command was sent to the board and the `.processBytes()` function is ready to reach for the specified channel.
534546
547+
### <a name="method-hard-set-board-type"></a> .hardSetBoardType(boardType)
548+
549+
Used to sync the module and board to `boardType`.
550+
551+
**Note: This has the potential to change the way data is parsed**
552+
553+
**_boardType_**
554+
555+
A String indicating the number of channels.
556+
557+
* `default` - Default board: Sample rate is `250Hz` and number of channels is `8`.
558+
* `daisy` - Daisy board: Sample rate is `125Hz` and number of channels is `16`.
559+
560+
**_Returns_** a promise, fulfilled if both the board and module are the requested `boardType`, rejects otherwise.
561+
535562
### <a name="method-impedance-test-all-channels"></a> .impedanceTestAllChannels()
536563
537564
To apply test signals to the channels on the OpenBCI board used to test for impedance. This can take a little while to actually run (<8 seconds)!
@@ -721,6 +748,19 @@ Get the current number of channels available to use. (i.e. 8 or 16).
721748
722749
**_Returns_** a number, the total number of available channels.
723750
751+
### <a name="method-override-info-for-board-type"></a> .overrideInfoForBoardType(boardType)
752+
753+
Set the info property for board type.
754+
755+
**Note: This has the potential to change the way data is parsed**
756+
757+
**_boardType_**
758+
759+
A String indicating the number of channels.
760+
761+
* `default` - Default board: Sample rate is `250Hz` and number of channels is `8`.
762+
* `daisy` - Daisy board: Sample rate is `125Hz` and number of channels is `16`.
763+
724764
### <a name="method-print-bytes-in"></a> .printBytesIn()
725765
726766
Prints the total number of bytes that were read in this session to the console.
@@ -847,34 +887,6 @@ Stop logging to the SD card and close any open file. If you are not streaming wh
847887
848888
**_Returns_** resolves if the command was added to the write queue.
849889
850-
### <a name="method-set-info-for-board-type"></a> .overrideInfoForBoardType(boardType)
851-
852-
Set the info property for board type.
853-
854-
**Note: This has the potential to change the way data is parsed**
855-
856-
**_boardType_**
857-
858-
A String indicating the number of channels.
859-
860-
* `default` - Default board: Sample rate is `250Hz` and number of channels is `8`.
861-
* `daisy` - Daisy board: Sample rate is `125Hz` and number of channels is `16`.
862-
863-
**_Returns_** a promise, fulfilled if the command was sent to the write queue. Rejects if input is not `8` or `16`.
864-
865-
### <a name="method-set-max-channels"></a> .setMaxChannels(numberOfChannels)
866-
867-
Sends a command to the board to set the max channels. If you have a daisy attached, calling this function will re-sniff for the daisy ADS and attempt to use it.
868-
869-
**_numberOfChannels_**
870-
871-
A Number indicating the number of channels.
872-
873-
* `8` - Default number of channels.
874-
* `16` - Daisy number of channels.
875-
876-
**_Returns_** a promise, fulfilled if the command was sent to the write queue. Rejects if input is not `8` or `16`.
877-
878890
### <a name="method-simulator-enable"></a> .simulatorEnable()
879891
880892
To enter simulate mode. Must call [`.connect()`](#method-connect) after.
@@ -1114,6 +1126,10 @@ Emitted when a packet (or packets) are dropped. Returns an array.
11141126
11151127
Emitted when there is an on the serial port.
11161128
1129+
### <a name="event-hard-set"></a> .on('hardSet', callback)
1130+
1131+
Emitted when the module detects the board is not configured as the options for the module intended and tries to save itself. i.e. when the `daisy` option is `true` and a soft reset message is parsed and the module determines that a daisy was not detected, the module will emit `hardSet` then send an attach daisy command to recover. Either `error` will be emitted if unable to attach or `ready` will be emitted if success.
1132+
11171133
### <a name="event-impedance-array"></a> .on('impedanceArray', callback)
11181134
11191135
Emitted when there is a new impedanceArray available. Returns an array.

openBCIBoard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ function OpenBCIFactory () {
10781078
};
10791079

10801080
/**
1081-
* Used to set the max number of channels on the Cyton board.
1081+
* Used to sync the module and board to `boardType`
10821082
* @param boardType {String}
10831083
* Either `default` or `daisy`
10841084
* @return {Promise}

0 commit comments

Comments
 (0)