From 9b90469ce796427309840c447b7de31920b1bb5d Mon Sep 17 00:00:00 2001 From: Benjamin Pettit Date: Tue, 28 Oct 2025 21:16:53 +1000 Subject: [PATCH] patch for thinkpulse --- eegnb/devices/eeg.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/eegnb/devices/eeg.py b/eegnb/devices/eeg.py index 1599b8a7d..d6e9e73a0 100644 --- a/eegnb/devices/eeg.py +++ b/eegnb/devices/eeg.py @@ -66,7 +66,8 @@ def __init__( mac_addr=None, other=None, ip_addr=None, - ch_names=None + ch_names=None, + config=None ): """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. @@ -84,6 +85,7 @@ def __init__( self.mac_address = mac_addr self.ip_addr = ip_addr self.other = other + self.config = config self.backend = self._get_backend(self.device_name) self.initialize_backend() self.n_channels = len(EEG_INDICES[self.device_name]) @@ -298,6 +300,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: