Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions eegnb/devices/eeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def __init__(
other=None,
ip_addr=None,
ch_names=None,
config=None,
make_logfile=False):
"""The initialization function takes the name of the EEG device and determines whether or not
the device belongs to the Muse or Brainflow families and initializes the appropriate backend.
Expand All @@ -87,6 +88,7 @@ def __init__(
self.mac_address = mac_addr
self.ip_addr = ip_addr
self.other = other
self.config = config
self.make_logfile = make_logfile # currently only used for kf
self.backend = self._get_backend(self.device_name)
self.initialize_backend()
Expand Down Expand Up @@ -311,6 +313,16 @@ def _init_brainflow(self):
self.board = BoardShim(self.brainflow_id, self.brainflow_params)
self.board.prepare_session()

# Apply board configuration if provided
if self.config:
# For Cyton boards, split config string by 'X' delimiter and apply each setting
if 'cyton' in self.device_name:
config_settings = self.config.split('X')
for setting in config_settings:
self.board.config_board(setting + 'X')
else:
self.board.config_board(self.config)

def _start_brainflow(self):
# only start stream if non exists
if not self.stream_started:
Expand Down
Loading