Skip to content

Commit

Permalink
add rotation channels for js
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
  • Loading branch information
Andrey1994 committed Sep 13, 2023
1 parent 6dd8d36 commit a9913b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions nodejs_package/brainflow/board_shim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class BoardControllerDLL extends BoardControllerFunctions
this.getPpgChannels = this.lib.func(CLike.get_ppg_channels);
this.getEdaChannels = this.lib.func(CLike.get_eda_channels);
this.getAccelChannels = this.lib.func(CLike.get_accel_channels);
this.getRotationChannels = this.lib.func(CLike.get_rotation_channels);
this.getAnalogChannels = this.lib.func(CLike.get_analog_channels);
this.getGyroChannels = this.lib.func(CLike.get_gyro_channels);
this.getOtherChannels = this.lib.func(CLike.get_other_channels);
Expand Down Expand Up @@ -548,6 +549,20 @@ export class BoardShim
return сhannels.slice(0, numChannels[0]);
}

public static getRotationChannels(
boardId: BoardIds, preset = BrainFlowPresets.DEFAULT_PRESET): number[]
{
const numChannels = [0];
const сhannels = [...new Array (512).fill(0)];
const res = BoardControllerDLL.getInstance().getRotationChannels(
boardId, preset, сhannels, numChannels);
if (res !== BrainFlowExitCodes.STATUS_OK)
{
throw new BrainFlowError (res, 'Could not get board info');
}
return сhannels.slice(0, numChannels[0]);
}

public static getAnalogChannels(
boardId: BoardIds, preset = BrainFlowPresets.DEFAULT_PRESET): number[]
{
Expand Down

0 comments on commit a9913b7

Please sign in to comment.