Brainflow's get_board_data() throws error 13 when called twice
I'm trying to use brainflow in Matlab for a P300 matrix speller. I need to get the data after a few trials such that: (1) start_stream() --> (2) Run trials (change color of rows and columns) --> (3) get_board_data() --> (4) process data --> (5) repeat 2-4
get_board_data() is what I need (return all data in the buffer, empty buffer) but seems I can't call it twice (eg:
data=get_board_data(); pause(2); data2=get_board_data() throws error 13).
get_current_board_data() could be used but I don't know how many samples are in the buffer (I need all of them) and I want to delete them.
What's the solution? What am I missing?