Simple parser for Mindwave Mobile EEG headsets.
- Download the library
- Unzip Mindwave-master.zip and rename the Mindwave-master folder to the Mindwave
- Move the freshly rename Mindwave folder into the Documents/Arduino/libraries and restart Arduino
If you're using the Serial class and simply want to get the attention value, it's as simple as this
#include <Mindwave.h> //import the library
Mindwave mindwave; //start using it
void setup() {
Serial.begin(MINDWAVE_BAUDRATE); //setup serial communication (MindWave mobile is set to 57600 baud rate)
}
//create a function to received new values as soon as they're avaialble
void onMindwaveData(){
Serial.print("attention: ");
Serial.println(mindwave.attention()); //access attention value
}
void loop() {
mindwave.update(Serial,onMindwaveData);//update using the data input(Serial in this case) and the function to call when data is ready
}
For more examples go to Arduino > File > Examples > Mindwave
Be aware, this is my first Arduino library, so things might not be 100% top-notch. The code is mostly based on the official NeuroSky wiki article and the ThinkGear protocol specs
However, it was developed for the Focus project. This is is covered on the following websites: