
NUI Chapter 10. Reading Your Mind with the MindWave

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg/

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

This directory contains 6 Java files:
 * ThinkGear.java, Wave.java,
   ReadMindWave.java,
   MindWaver.java, MindReader.java,
   ReadPacketsLog.java


The NeuroSky TGCD driver (v.2.1), which I copied from
the MindSet Development Tools, available at
http://store.neurosky.com/products/mindset-development-tools
 * thinkgear.dll


A packets log file for testing ReadPacketsLog.java
  * packetsLog.txt


Two batch files:
  *  compile.bat
  *  run.bat
     - make sure they refer to the correct location for JNA and JFreeChart


----------------------------
Before Compilation/Execution:

You need to buy and install:
  * NeuroSky MindWave headset (about $100)
    -- details at http://www.neurosky.com

You need to download and install:
  * the MindSet Development Tools (MDT)
    -- a free download from 
       http://store.neurosky.com/products/mindset-development-tools

  * JNA
    -- available from https://github.com/twall/jna

  * JFreeChart
    -- available from http://www.jfree.org/jfreechart/


----------------------------
Hints of Getting the NeuroSky headset to work:

* first test it on the example applications and games that come
  with the headset

* make sure the headset is switched on

* make sure the forehead sensor and earlobe clip are firmly
  touching skin, not hair

* the Neurosky typically takes a few seconds to 'warm up' and start
  sending data


----------------------------
Compilation:

* run "MindWave Manager" from the NeuroSky utilities menu; write
  down the headset's COM port number

* update the COM_PORT constant in
  ReadMindWave.java *and* MindReader.java

> compile *.java
     - make sure compile.bat refers to the correct locations 
       for JNA and JFreeChart


----------------------------
Execution:

Make sure run.bat refers to the correct locations 
for JNA and JFreeChart.

> run ReadMindWave
    -- prints a text-based stream of output from the MindWave
       * change the call to printAllWaves() to printWaves() in
         ReadMindWave() to reduce the volume of output


> run MindWaver
    -- prints a text-based stream of output from the MindWave
       and a graph of the attention and meditation levels and blink strength


> run ReadPacketsLog packetsLog.txt
or
> run ReadPacketsLog packetsLog.txt raw
    -- displays the information from the specified log file;
       (without or with raw data included)


----------------------------
Last updated: 5th November 2012
