MindWave Element
The MindWave headset’s sensor measures the brain’s electrical activity
and transfers the data readout via a WiFi USB connection to your
computer (Windows or Mac).
This EJS element allows you to control the NeuroSky MindWave
through the ThinkGear connector (via socket). You will be able to:
- Read attention level.
- Read meditation level.
- Read blink strength.
- Read EEG data.
- Read signal level.
- Detect double blinks with programmable delay between the two
single blinks.
Usage
To add the element, simply drag and drop the element from the
palette to the list of elements for your simulation.
Available methods
- boolean connect(); Starts
the connection to the Neurosky Mindwave headset.
- bolean close(); Closes
the connection to the Neurosky Mindwave headset.
- int getAttentionLevel(); Returns the current attention
level [0, 100]. Values in [1, 20] are considered strongly lowered.
Values in [20, 40] are considered reduced levels. Values in [40, 60]
are considered neutral. Values in [60, 80] are considered slightly
elevated. Values in [80, 100] are considered elevated.
- int getMeditationLevel();
Returns the current meditation level [0, 100]. Values in [1, 20] are
considered strongly lowered. Values in [20, 40] are considered reduced
levels. Values in [40, 60] are considered neutral. Values in [60, 80]
are considered slightly elevated. Values in [80, 100] are considered
elevated.
- int getSignalLevel();
Returns the signal level [0, 200]. The greater the value, the more
noise is detected in the signal. 200 is a special value that means that
the ThinkGear contacts are not touching the skin.
- int getBlinkLevel(); Returns the blink level [0, 255]. The greater the value, the more
powerful blink is detected.
- boolean getDoubleBlink(int minDistance,
int maxDistance); Returns if a double blink with a duration
between two values has been detected.
- int[] getEEGValue();
Returns the EEG data. The values have no units. {delta, theta,
lowAlpha, highAlpha, lowBeta, highBeta, lowGamma, highGamma}.
- int getDelta();
Returns the delta band of EEG.
- int getTheta();
Returns the theta band of EEG.
- int getLowAplpha();
Returns the low alpha band of EEG.
- int getHighAlpha();
Returns the high alpha band of EEG.
- int getLowBeta();
Returns the low beta band of EEG.
- int getHighBeta();
Returns the high beta band of EEG;
- int getLowGamma();
Returns the low gamma band of EEG.
- int getHighGamma();
Returns the high gamma band of EEG.
- int[] getRawData();
Returns the raw data from the MindWave Sensor (512 int values).
Example of use
if (!mindWave.connect()) {
_view.alert("","Error","MindWave not detected. Is ThinkGear running?");
_pause();
}
else {
_println("MindWave connected");
}
// evolution...
//
attention = mindWave.getAttentionLevel();
blink = mindWave.getBlinkLevel();
signal = mindWave.getSignalLevel();
meditation = mindWave.getMeditationLevel();
doubleBlink = mindWave.getDoubleBlink(200, 1000);
//
thetaBand = mindWave.getTheta();