Skip to content

Commit fbde510

Browse files
committed
V1.1
1 parent e94f6c6 commit fbde510

File tree

2 files changed

+108
-3
lines changed

2 files changed

+108
-3
lines changed

INFO.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
PyNeuro
2+
=======
3+
4+
PyNeuro is designed to connect NeuroSky's MindWave EEG device to Python
5+
and provide Callback functionality to provide data to your application
6+
in real time. The library is tested with Mindwave Mobie2 Headset, and
7+
runs stably.
8+
9+
Installation
10+
------------
11+
12+
Run the following command: ``pip install PyNeuro``
13+
14+
Usage
15+
-----
16+
17+
1. Importing the module: ``from NeuroPy import NeuroPy``
18+
2. Initializing: ``pn = PyNeuro()``
19+
3. After initializing, if required the callbacks can be set
20+
4. Then call ``pn.connect()`` method, it will connect with TCP Socket
21+
server.
22+
5. Then call ``pn.start()`` method, it will be start fetching data.
23+
6. To stop call ``pn.close()``
24+
25+
Obtaining Data from Device
26+
~~~~~~~~~~~~~~~~~~~~~~~~~~
27+
28+
- **Obtaining value:** ``attention = pn.attention`` #to get value of
29+
attention\_ >\ **Other Variable** attention, meditation,
30+
blinkStrength, will be added more soon.
31+
32+
- **Setting callback:** A call back can be associated with all the
33+
above variables so that a function is called when the variable is
34+
updated. Syntax:
35+
36+
::
37+
38+
pn.set_attention_callback(callback_function1)
39+
pn.set_meditation_callback(callback_function2)
40+
pn.set_blinkStrength_callback(callback_function3)
41+
42+
You can add any number of callback functions to a variable..
43+
44+
Sample Program 1 (Access via callback)
45+
--------------------------------------
46+
47+
.. code:: python
48+
49+
from PyNeuro import PyNeuro
50+
from time import sleep
51+
52+
pn = PyNeuro()
53+
54+
def attention_callback(attention_value):
55+
"""this function will be called everytime NeuroPy has a new value for attention"""
56+
print ("Value of attention is: ", attention_value)
57+
return None
58+
59+
pn.set_attention_callback("attention", attention_callback)
60+
pn.connect()
61+
pn.start()
62+
63+
try:
64+
while True:
65+
sleep(0.2)
66+
finally:
67+
neuropy.close()
68+
69+
Sample Program 2 (Access via object)
70+
------------------------------------
71+
72+
.. code:: python
73+
74+
from PyNeuro import PyNeuro
75+
from time import sleep
76+
77+
pn = PyNeuro()
78+
pn.start()
79+
80+
while True:
81+
if pn.meditation > 70: # Access data through object
82+
pn.close()
83+
sleep(0.2)
84+
85+
Python Compatibility
86+
--------------------
87+
88+
- `Python <http://www.python.com>`__ -v3.\*
89+
90+
Reference
91+
~~~~~~~~~
92+
93+
`lihas/NeuroPy <https://github.com/lihas/NeuroPy>`__ - A library based
94+
on native Bluetooth serial connection

setup.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
from distutils.core import setup
1+
from setuptools import setup
2+
3+
24

35
setup(name="PyNeuro",
4-
version="1.0",
6+
version="1.1",
57
description="Library for connect with Neurosky's Mindwave EEG headset via TCP Socket",
68
author="Zach Wang",
79
author_email="[email protected]",
10+
long_description=open('INFO.rst', 'r').read(),
11+
license="MIT",
12+
classifiers=[
13+
"License :: OSI Approved :: MIT License",
14+
"Programming Language :: Python :: 3",
15+
"Programming Language :: Python :: 3.7",
16+
],
817
url="https://github.com/ZACHSTRIVES/PyNeuro",
9-
packages=['PyNeuro']
18+
packages=['PyNeuro'],
19+
20+
1021
)

0 commit comments

Comments
 (0)