Collects data from any OpenBCI board and spread out over time. Mainly useful with wifi shield where packages arrives in chunks. Can also act like a buffer and increase timing accuracy when sending OpenBCI data from sclang to scserver.
Internally it has two Routines, one for data and one for accelerometer, and they both run on the SystemClock. The samplerate for the data routine is the board's sample rate, and the accelerometer routine run at 25Hz. These samplerates can be tuned to run slightly slower with the -factor method (default 0.99).
create a new instance
board |
an instance of a OpenBCI subclass (for example a CytonWifi or GanglionWifi). |
maxSize |
the number of slots in both data and accelerometer buffers. If the data is not read fast enough, the buffers will fill up to this size and then start dropping values (fifo). |
dataActive |
a Boolean flag indicating if data should be buffered or not. If only using the accelerometer set this flag to false to save some CPU and memory. |
accelActive |
a Boolean flag indicating if accelerometer data should be buffered or not. If not using the accelerometer set this flag to false to save some CPU and memory. |
get the board instance
start sequencing
stop sequencing
set the OpenBCI: -dataAction
set the OpenBCI: -accelAction
last brain wave data readings as an Array.
last accelerometer readings as an Array.
a Boolean flag indicating if data should be buffered or not.
a Boolean flag indicating if accelerometer data should be buffered or not.
a Boolean flag indicating if the data buffer filled up to its maximum.
a Boolean flag indicating if the accel buffer filled up to its maximum.
get or set the maxSize.
current data buffer.
current accel buffer.
clear buffers and flags
get or set the time scaling factor. For safety keep this slightly under 1.0.