Skip to content

Commit

Permalink
Add print of Galea Beta gain values
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacplotkin committed Feb 20, 2024
1 parent 97f11c8 commit 8c15bed
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/board_controller/openbci/galea_v4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,23 @@ int GaleaV4::config_board (std::string conf, std::string &response)
return res;
}

if (conf == "get_gains")
{
std::stringstream gains;

for (int i = 0; i < 20; i++)
{
gains << gain_tracker.get_gain_for_channel (i);
if (i < 19)
{
gains << ", ";
}
}
response = gains.str ();
safe_logger (spdlog::level::info, "gains for all channels: {}", response);
return (int)BrainFlowExitCodes::STATUS_OK;
}

if (gain_tracker.apply_config (conf) == (int)OpenBCICommandTypes::INVALID_COMMAND)
{
safe_logger (spdlog::level::warn, "invalid command: {}", conf.c_str ());
Expand Down Expand Up @@ -192,6 +209,13 @@ int GaleaV4::config_board (std::string conf, std::string &response)
"recommended to call stop_stream before config_board");
}

// log gain for all channels
for (int i = 0; i < 28; i++)
{
safe_logger (spdlog::level::info, "gain for channel {} is {}", i,
gain_tracker.get_gain_for_channel (i));
}

return (int)BrainFlowExitCodes::STATUS_OK;
}

Expand Down

0 comments on commit 8c15bed

Please sign in to comment.