Arduino library to interface with the Mindwave Mobile brainwave reader. Based on the sample Arduino code from Neurosky, with some modifications to make it non-blocking, more object oriented and easier to use.
1- Download the zip file and decompress it in the “libraries” folder of your Arduino sketches folder. Restart the Arduino environment.
3- Open the example at File/Examples/Mindwave/BasicMindwave and upload it to the Arduino. The wire to the Rx pin (0) will have to be unplugged or you will get an error. Plug it back after uploading, and see the console for the Serial port at 57600 bauds.
Create a new sketch and include the Mindwave library through the menu Sketch/Import Library/Mindwave
Declare a Mindwave object and start using the following functions>
Initializes the class and opens a serial port at 57600 bauds. Needs to be called in the setup() function of the sketch.
Listens for new brainwave data and parses it. Needs to be called in the update() function of the sketch.
void setDebug(boolean debug)
Tells the Mindwave class whether to print the received data or not.
void setTimeout(long t)
Sets the millis that it will take before deciding that there is not data coming in, and setting the quality to 0. Default is 5000 (5 seconds).
Returns a boolean indicating if a new data packet has been parsed.
Returns a boolean indicating if the Mindwave is set to debug.
Returns a number from 0 to 100 with the level of attention or meditation.
Returns a number from 0 to 200 with the quality of the signal. Quality goes from 0 (bad quality) to 200 (good) and PoorQuality is the inverse.