You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,7 +162,7 @@ Time Syncing
162
162
------------
163
163
You must be using OpenBCI firmware version 2 in order to do time syncing. After you `.connect()` and send a `.softReset()`, you can call `.usingVersionTwoFirmware()` to get a boolean response as to if you are using `v1` or `v2`.
164
164
165
-
Now using firmware `v2`, the fun begins! We synchronize the Board's clock with the module's time. In firmware `v2` we leverage samples with time stamps and different time stamps and unique new features to calculate a time sync strategy. Time syncing has been verified to +/- 4ms and a test report is on the way. We are still working on the synchronize of this module and an NTP server, this is an open call for any NTP experts out there! With a global NTP server you could use several different devices and all sync to the same time server. That way you can really do some serious cloud computing!
165
+
Now using firmware `v2`, the fun begins! We synchronize the Board's clock with the module's time. In firmware `v2` we leverage samples with time stamps and _ACKs_ from the Dongle to form a time synchronization strategy. Time syncing has been verified to +/- 4ms and a test report is on the way. We are still working on the synchronize of this module and an NTP server, this is an open call for any NTP experts out there! With a global NTP server you could use several different devices and all sync to the same time server. That way you can really do some serious cloud computing!
166
166
167
167
Keep your resync interval above 50ms. While it's important to resync every couple minutes due to drifting of clocks, please do not try to sync without getting the last sync event! We can only support one sync operation at a time!
* `simulatorSampleRate` {Number} - The sample rate to use for the simulator. Simulator will set to 125 if `simulatorDaisyModuleAttached` is set `true`. However, setting this option overrides that setting and this sample rate will be used. (Default is `250`)
378
378
* `simulatorSerialPortFailure` {Boolean} - Simulates not being able to open a serial connection. Most likely due to a OpenBCI dongle not being plugged in.
379
-
* `sntpTimeSync` - {Boolean} Syncs the module up with an SNTP time server and uses that as single source of truth instead of local computer time. (Default `true`)
379
+
* `sntpTimeSync` - {Boolean} Syncs the module up with an SNTP time server and uses that as single source of truth instead of local computer time. If you are running experiments on your local computer, keep this `false`. (Default `false`)
380
380
* `sntpTimeSyncHost` - {String} The sntp server to use, can be either sntp or ntp (Defaults `pool.ntp.org`).
381
381
* `sntpTimeSyncPort` - {Number} The port to access the sntp server (Defaults `123`)
382
-
* `verbose` {Boolean} - Print out useful debugging events
**Note, we have added support for either all lowercase OR camel case for the options, use whichever style you prefer.**
385
385
@@ -879,6 +879,8 @@ Send the command to tell the board to start the syncing protocol. Must be connec
879
879
880
880
**Example**
881
881
882
+
Syncing multiple times to base the offset of the average of the four syncs.
883
+
882
884
```javascript
883
885
var OpenBCIBoard =require('openbci').OpenBCIBoard,
884
886
ourBoard =newOpenBCIBoard({
@@ -1068,7 +1070,7 @@ The name of the simulator port.
1068
1070
1069
1071
### LabStreamingLayer
1070
1072
1071
-
[LabStreamingLayer](https://github.com/sccn/labstreaminglayer) by SCCN is a stream management tool designed to time-synchronize multiple data streams, potentially from different sources, over a LAN network with millisecond accuracy (given configuration).
1073
+
[LabStreamingLayer](https://github.com/sccn/labstreaminglayer) by SCCN is a stream management tool designed to time-synchronize multiple data streams, potentially from different sources, over a LAN network with millisecond accuracy (given configuration).
1072
1074
1073
1075
For example, a VR display device running a Unity simulation may, using the [LSL4Unity](https://github.com/xfleckx/LSL4Unity) library, emit string markers into LSL corresponding to events of interest (For the P300 ERP, this event would be the onset of an attended, unusual noise in a pattern of commonplace ones). The computer doing data collection via the OpenBCI_NodeJS library (potentially with 4ms accuracy) would then output into an LSL stream the EEG and AUX data. LSL can then synchronize the two clocks relative to each other before inputting into a different program or toolkit, like [BCILAB](https://github.com/sccn/BCILAB) for analysis to trigger responses in the Unity display.
switch(sampleNumber%10){// The accelerometer is on a 25Hz sample rate, so every ten channel samples, we can get new data
793
793
casek.OBCIAccelAxisX:
794
-
accelArray[k.OBCIAccelAxisX]=sampleModule.interpret16bitAsInt32(dataBuf.slice(lastBytePosition,lastBytePosition+2))*SCALE_FACTOR_ACCEL;// slice is not inclusive on the right
794
+
accelArray[0]=sampleModule.interpret16bitAsInt32(dataBuf.slice(lastBytePosition,lastBytePosition+2))*SCALE_FACTOR_ACCEL;// slice is not inclusive on the right
795
795
resolve(false);
796
796
break;
797
797
casek.OBCIAccelAxisY:
798
-
accelArray[k.OBCIAccelAxisY]=sampleModule.interpret16bitAsInt32(dataBuf.slice(lastBytePosition,lastBytePosition+2))*SCALE_FACTOR_ACCEL;// slice is not inclusive on the right
798
+
accelArray[1]=sampleModule.interpret16bitAsInt32(dataBuf.slice(lastBytePosition,lastBytePosition+2))*SCALE_FACTOR_ACCEL;// slice is not inclusive on the right
799
799
resolve(false);
800
800
break;
801
801
casek.OBCIAccelAxisZ:
802
-
accelArray[k.OBCIAccelAxisZ]=sampleModule.interpret16bitAsInt32(dataBuf.slice(lastBytePosition,lastBytePosition+2))*SCALE_FACTOR_ACCEL;// slice is not inclusive on the right
802
+
accelArray[2]=sampleModule.interpret16bitAsInt32(dataBuf.slice(lastBytePosition,lastBytePosition+2))*SCALE_FACTOR_ACCEL;// slice is not inclusive on the right
0 commit comments