()
| 5 | |
| 6 | |
| 7 | def 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 | |
| 37 | if __name__ == "__main__": |
no test coverage detected