Skip to main content

Library for interfacing with Neurosky's Mindwave EEG headset

Project description

NeuroSkyPy

NeuroSkyPy library written in python3.7 to connect, interact, get, save and plot data from NeuroSky's MindWave EEG headset, the first one ( black ).

This library is based on the mindwave mindset communication protocol published by Neurosky and is tested with Neurosky Mindwave EEG headset. Where It's readen the data in hex, after that it's decoded.

Installation

Source file

  1. Download the source file from github
  2. Unzip and navigate to the folder containing setup.py and other files
  3. Run the following command: python setup.py install

Pip

    pip3 install NeuroSkyPy

Usage

A test-script which is used as experiment it's left in order to check and learn how to use the class. The basic steps to use the class are:

  1. Importing the module: from NeuroPy import NeuroPy
  2. Initializing: neuropy = NeuroPy()
  3. After initializing, either the callbacks can be set or just extract data from the object as it's done in test-script.
  4. Then call neuropy.start() method, it will start fetching data from mindwave.
  5. To stop call neuropy.stop() WARNING: The main problem it's that the thread is not stopped so it will trigger a error. Nevermind you could continue using the script.

Obtaining Data from Device

  • Obtaining value: attention = neuropy.attention #to get value of attention_

    Other Variable attention, meditation, rawValue, delta, theta, lowAlpha, highAlpha, lowBeta, highBeta, lowGamma, midGamma, poorSignal and blinkStrength

  • Setting callback: A call back can be associated with all the above variables so that a function is called when the variable is updated. Syntax:

    setCallBack("[variable]",callback_function)
    

    for eg. to set a callback for attention data the syntax will be

    setCallBack("attention",callback_function)
    

    Other Variables: attention, meditation, rawValue, delta, theta, lowAlpha, highAlpha, lowBeta, highBeta, lowGamma, midGamma, poorSignal and blinkStrength

Sample Program 1 (Access via callback)

from NeuroPy import NeuroPy
from time import sleep

neuropy = NeuroPy() 

def attention_callback(attention_value):
    """this function will be called everytime NeuroPy has a new value for attention"""
    print ("Value of attention is: ", attention_value)
    return None

neuropy.setCallBack("attention", attention_callback)
neuropy.start()

try:
    while True:
        sleep(0.2)
finally:
    neuropy.stop()

Sample Program 2 (Access via object)

from NeuroPy import NeuroPy
from time import sleep

neuropy = NeuroPy() 
neuropy.start()

while True:
    if neuropy.meditation > 70: # Access data through object
        neuropy.stop() 
    sleep(0.2) # Don't eat the CPU cycles

Python Compatibility

Note

This library comes from the libraries NeuroPy and mindwave-python. The library is tested and comes with extracted data.

More Information

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NeuroSkyPy-1.6.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

NeuroSkyPy-1.6-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file NeuroSkyPy-1.6.tar.gz.

File metadata

  • Download URL: NeuroSkyPy-1.6.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.2

File hashes

Hashes for NeuroSkyPy-1.6.tar.gz
Algorithm Hash digest
SHA256 bdb792ac3dca730b311f129a86b1c8fdf79254c64acb40ff7eee6b01ef89da20
MD5 7f26597d87a5bea02389d6232934069e
BLAKE2b-256 66146eef72ded226d1e296cdaaf2d24a4e1f61d95beae34d047117ad21391d6b

See more details on using hashes here.

File details

Details for the file NeuroSkyPy-1.6-py3-none-any.whl.

File metadata

  • Download URL: NeuroSkyPy-1.6-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.2

File hashes

Hashes for NeuroSkyPy-1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e92f47745cda7f15a0292f8403b7dbc02668412427a8b51db6e754093ba8ecf0
MD5 b65a5660f096520f2d483b2a78ad7099
BLAKE2b-256 5400c94dabcfb95e00726dd98546c720842a9881d7783500245083b9d793f87f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page