Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 2.6 KB

readme.md

File metadata and controls

87 lines (61 loc) · 2.6 KB

Guideline for C++ to work with EMOTIV LSL Interface

The following guide describes how C++ works with EMOTIV LSL Interface.

Prerequisites

  • Require C++ compiler (gcc, MinGW, etc)
  • Install CMake version 3.5 or later

How to build project

  1. Clone this repository
git clone https://github.com/Emotiv/labstreaminglayer.git
  1. Go to examples/cpp and create the build directory

  2. Configure the project using cmake

For Windows 64-bit please add the param -DWIN64=1

mkdir build && cd build

# if you prefer to generate a project file for your IDE
# checkout https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html
cmake .. -G <generator name>

For example: 
 Generates Visual Studio 15 (VS 2017) project files.
    cmake .. -G "Visual Studio 15 2017" -A x64 -DWIN64=1
 Generate Xcode project files
    cmake .. -G Xcode

If you use a generator, you can now open the generated project file with your IDE. Then build the install target. Alternatively, you can build directly from command line:

cmake --build . --config Release --target install

How to receive data from EMOTIV LSL Outlet stream in C++

  1. Go to Lab Streaming Layer page, Outlet tab in EmotivPRO, choose the desire Data stream type and Data format Click Start button to start streaming.

  2. Build and run ReceiveData binary.

If you run it from IDE, please enter a field name and the desired value and transmitType (sample or chunk) on console as below:

type EEG sample
or
name EmotivDataStream-EEG sample

If you run the executable directly on command line:

ReceiveData type Motion chunk 50
or 
ReceiveData name EmotivDataStream-Motion chunk 50

The last parameter is the number of sample to be printed out in console.

  1. If succeeded you can see the result like this:

How to send marker from C++ to EMOTIV LSL Inlet

EMOTIV LSL Inlet supports add both simple marker and marker with desire event time.

  1. Build and Run SendMarker or SendSimpleMarker.

  2. Go to Lab Streaming Layer page, Inlet tab on EmotivPRO, choose MarkerWithTimeStamp or SimpleMarker in stream name. Then click the Connect button.

  3. If succeeded you can see the result like this:

Reference