MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / main

Function main

python_package/examples/tests/cyton_commands.py:7–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def main():
8 BoardShim.enable_dev_board_logger()
9
10 parser = argparse.ArgumentParser()
11 parser.add_argument('--serial-port', type=str, help='serial port', required=True)
12 args = parser.parse_args()
13
14 params = BrainFlowInputParams()
15 params.serial_port = args.serial_port
16
17 board = BoardShim(BoardIds.CYTON_BOARD, params)
18 try:
19 board.prepare_session()
20 resp = board.config_board('?')
21 print(resp)
22 # check that there is a response if streaming is off
23 if not resp:
24 raise ValueError('resp is None')
25 board.start_stream()
26 time.sleep(5)
27 resp = board.config_board('?')
28 print(resp)
29 # check that there is no response if streaming is on
30 if resp:
31 raise ValueError('resp is not None')
32 finally:
33 if board.is_prepared():
34 board.release_session()
35
36
37if __name__ == "__main__":

Callers 1

cyton_commands.pyFile · 0.70

Calls 9

prepare_sessionMethod · 0.95
config_boardMethod · 0.95
start_streamMethod · 0.95
is_preparedMethod · 0.95
release_sessionMethod · 0.95
BoardShimClass · 0.90
parse_argsMethod · 0.45

Tested by

no test coverage detected