The following guide describes how C++ works with EMOTIV LSL Interface.
- Require C++ compiler (gcc, MinGW, etc)
- Install CMake version 3.5 or later
- Clone this repository
git clone https://github.com/Emotiv/labstreaminglayer.git
-
Go to
examples/cpp
and create the build directory -
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
-
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.
-
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.
- If succeeded you can see the result like this:
EMOTIV LSL Inlet supports add both simple marker and marker with desire event time.
-
Build and Run
SendMarker
orSendSimpleMarker
. -
Go to Lab Streaming Layer page, Inlet tab on EmotivPRO, choose MarkerWithTimeStamp or SimpleMarker in stream name. Then click the Connect button.
-
If succeeded you can see the result like this:
- LabStreamingLayer https://labstreaminglayer.readthedocs.io/