You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is our hope that any one is able to contribute to OpenBCI Python regardless of their background. Thus, we hope to provide a safe, welcoming, and warmly geeky environment for everybody, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
6
+
7
+
## Our Standards
8
+
9
+
Examples of behavior that contributes to creating a positive environment
10
+
include:
11
+
12
+
* Using welcoming and inclusive language
13
+
* Being respectful of differing viewpoints and experiences
14
+
* Gracefully accepting constructive criticism
15
+
* Focusing on what is best for the community
16
+
* Showing empathy towards other community members
17
+
18
+
Examples of unacceptable behavior by participants include:
19
+
20
+
* The use of sexualized language or imagery and unwelcome sexual attention or
21
+
advances
22
+
* Trolling, insulting/derogatory comments, and personal or political attacks
23
+
* Public or private harassment
24
+
* Publishing others' private information, such as a physical or electronic
25
+
address, without explicit permission
26
+
* Other conduct which could reasonably be considered inappropriate in a
27
+
professional setting
28
+
29
+
## Our Responsibilities
30
+
31
+
Project maintainers are responsible for clarifying the standards of acceptable
32
+
behavior and are expected to take appropriate and fair corrective action in
33
+
response to any instances of unacceptable behavior.
34
+
35
+
Project maintainers have the right and responsibility to remove, edit, or
36
+
reject comments, commits, code, wiki edits, issues, and other contributions
37
+
that are not aligned to this Code of Conduct, or to ban temporarily or
38
+
permanently any contributor for other behaviors that they deem inappropriate,
39
+
threatening, offensive, or harmful.
40
+
41
+
## Scope
42
+
43
+
This Code of Conduct applies both within project spaces and in public spaces
44
+
when an individual is representing the project or its community. Examples of
45
+
representing a project or community include using an official project e-mail
46
+
address, posting via an official social media account, or acting as an appointed
47
+
representative at an online or offline event. Representation of a project may be
48
+
further defined and clarified by project maintainers.
49
+
50
+
## Enforcement
51
+
52
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
:tada::clinking_glasses: First off, thanks for taking the time to contribute! :tada::clinking_glasses:
4
+
5
+
Contributions are always welcome, no matter how small.
6
+
7
+
The following is a small set of guidelines for how to contribute to the project
8
+
9
+
## Where to start
10
+
11
+
### Code of Conduct
12
+
This project adheres to the Contributor Covenant [Code of Conduct](CODE_OF_CONDUCT.md).
13
+
By participating you are expected to adhere to these expectations. Please report unacceptable behaviour to [[email protected]](mailto:[email protected])
14
+
15
+
### Contributing on Github
16
+
17
+
If you're new to Git and want to learn how to fork this repo, make your own additions, and include those additions in the master version of this project, check out this [great tutorial](http://blog.davidecoppola.com/2016/11/howto-contribute-to-open-source-project-on-github/).
18
+
19
+
### Community
20
+
21
+
This project is maintained by the [OpenBCI](www.openbci.com) and [NeuroTechX](www.neurotechx.com) community. Join the NeuroTechX Slack to check out our #devices channel, where discussions about OpenBCI takes place.
22
+
23
+
## How can I contribute?
24
+
25
+
If there's a feature you'd be interested in building, go ahead and we'll support you as much as we can. When you're finished submit a pull request to the master branch referencing the specific issue you addressed.
26
+
27
+
If you find a bug, or have a suggestion on how to improve the project, just fill out a [Github issue](../../issues)
First and foremost, Welcome! :tada: Willkommen! :confetti_ball: Bienvenue! :balloon::balloon::balloon:
15
+
16
+
Thank you for visiting the OpenBCI Python repository. his python code is meant to be used by people familiar with python and programming in general. It's purpose is to allow for programmers to interface with OpenBCI technology directly, both to acquire data and to write programs that can use that data on a live setting, using python.
17
+
18
+
This document (the README file) is a hub to give you some information about the project. Jump straight to one of the sections below, or just scroll down to find out more.
19
+
20
+
*[What are we doing? (And why?)](#what-are-we-doing)
21
+
*[Who are we?](#who-are-we)
22
+
*[What do we need?](#what-do-we-need)
23
+
*[How can you get involved?](#get-involved)
24
+
*[Get in touch](#contact-us)
25
+
*[Find out more](#find-out-more)
26
+
*[Glossary](#glossary)
27
+
*[Dependencies](#dependencies)
28
+
*[Install](#install)
29
+
*[Functionality](#functionality)
30
+
31
+
## What are we doing?
32
+
33
+
### The problem
34
+
35
+
* OpenBCI is an incredible biosensor that can be challenging to work with
36
+
* Data comes into the computer very quickly
37
+
* Complex byte streams
38
+
* Lot's of things can go wrong when dealing with a raw serial byte stream
39
+
* The boards all use different physical technologies to move data to computers such as bluetooth or wifi
40
+
* Developers want to integrate OpenBCI with other platforms and interfaces
41
+
42
+
So, if even the very best developers want to use Python with their OpenBCI boards, they are left scratching their heads with where to begin.
43
+
44
+
### The solution
45
+
46
+
The OpenBCI Python will:
47
+
48
+
* Allow Python users to install one module and use any board they choose
49
+
* Provide examples of using Python to port data to other apps like lab streaming layer
50
+
* Perform the heavy lifting when extracting and transforming raw binary byte streams
51
+
* Use unit tests to ensure perfect quality of core code
52
+
53
+
Using this repo provides a building block for developing with Python. The goal for the Python library is to ***provide a stable Python driver for all OpenBCI Biosensors***
54
+
55
+
## Who are we?
56
+
57
+
The founder of the OpenBCI Python repository is Jermey Frey. The Python driver is one of the most popular repositories and has the most contributors!
58
+
59
+
The contributors to these repos are people using Python mainly for their data acquisition and analytics.
60
+
61
+
## What do we need?
62
+
63
+
**You**! In whatever way you can help.
64
+
65
+
We need expertise in programming, user experience, software sustainability, documentation and technical writing and project management.
66
+
67
+
We'd love your feedback along the way.
68
+
69
+
Our primary goal is to provide a stable Python driver for all OpenBCI Biosensors, and we're excited to support the professional development of any and all of our contributors. If you're looking to learn to code, try out working collaboratively, or translate you skills to the digital domain, we're here to help.
70
+
71
+
## Get involved
72
+
73
+
If you think you can help in any of the areas listed above (and we bet you can) or in any of the many areas that we haven't yet thought of (and here we're *sure* you can) then please check out our [contributors' guidelines](CONTRIBUTING.md) and our [roadmap](ROADMAP.md).
74
+
75
+
Please note that it's very important to us that we maintain a positive and supportive environment for everyone who wants to participate. When you join us we ask that you follow our [code of conduct](CODE_OF_CONDUCT.md) in all interactions both on and offline.
76
+
77
+
## Contact us
78
+
79
+
If you want to report a problem or suggest an enhancement we'd love for you to [open an issue](../../issues) at this github repository because then we can get right on it. But you can also contact [AJ][link_aj_keller] by email (pushtheworldllc AT gmail DOT com) or on [twitter](https://twitter.com/aj-ptw).
80
+
81
+
## Find out more
82
+
83
+
You might be interested in:
84
+
85
+
* Purchase a [Cyton][link_shop_cyton] | [Ganglion][link_shop_ganglion] | [WiFi Shield][link_shop_wifi_shield] from [OpenBCI][link_openbci]
86
+
* Get taught how to use OpenBCI devices by [Push The World][link_ptw] BCI Consulting
87
+
88
+
And of course, you'll want to know our:
89
+
90
+
*[Contributors' guidelines](CONTRIBUTING.md)
91
+
*[Roadmap](ROADMAP.md)
92
+
93
+
## Glossary
94
+
95
+
OpenBCI boards are commonly referred to as _biosensors_. A biosensor converts biological data into digital data.
96
+
97
+
The [Ganglion][link_shop_ganglion] has 4 channels, meaning the Ganglion can take four simultaneous voltage readings.
98
+
99
+
The [Cyton][link_shop_cyton] has 8 channels and [Cyton with Daisy][link_shop_cyton_daisy] has 16 channels.
100
+
101
+
Generally speaking, the Cyton records at a high quality with less noise. Noise is anything that is not signal.
102
+
103
+
## Thank you
104
+
105
+
Thank you so much (Danke schön! Merci beaucoup!) for visiting the project and we do hope that you'll join us on this amazing journey to make programming with OpenBCI fun and easy.
106
+
107
+
## Dependencies
9
108
10
109
* Python 2.7 or later (https://www.python.org/download/releases/2.7/)
11
110
* Numpy 1.7 or later (http://www.numpy.org/)
@@ -31,12 +130,6 @@ On linux, assuming `hci0` is the name of your bluetooth adapter:
This python code is meant to be used by people familiar with python and programming in general. It's purpose is to allow for programmers to interface with OpenBCI technology directly, both to acquire data and to write programs that can use that data on a live setting, using python.
37
-
38
-
If this is not what you are looking for, you can visit http://openbci.com/downloads and browse other OpenBCI software that will fit your needs.
39
-
40
133
## Install
41
134
42
135
### Using PyPI
@@ -65,7 +158,7 @@ python setup.py develop
65
158
66
159
### Basic usage
67
160
68
-
The startStreaming function of the Board object takes a callback function and begins streaming data from the board. Each packet it receives is then parsed as an OpenBCISample which is passed to the callback function as an argument.
161
+
The startStreaming function of the Board object takes a callback function and begins streaming data from the board. Each packet it receives is then parsed as an OpenBCISample which is passed to the callback function as an argument.
69
162
70
163
OpenBCISample members:
71
164
-id:
@@ -79,13 +172,13 @@ OpenBCISample members:
79
172
80
173
### user.py
81
174
82
-
This code provides a simple user interface (called user.py) to handle various plugins and communicate with the board. To use it, connect the board to your computer using the dongle (see http://docs.openbci.com/tutorials/01-GettingStarted for details).
175
+
This code provides a simple user interface (called user.py) to handle various plugins and communicate with the board. To use it, connect the board to your computer using the dongle (see http://docs.openbci.com/tutorials/01-GettingStarted for details).
83
176
84
177
Then simply run the code given as an argument the port your board is connected to:
85
178
Ex Linux:
86
-
> $python user.py -p /dev/ttyUSB0
179
+
> $python user.py -p /dev/ttyUSB0
87
180
88
-
The program should establish a serial connection and reset the board to default settings. When a '-->' appears, you can type a character (character map http://docs.openbci.com/software/01-OpenBCI_SDK) that will be sent to the board using ser.write. This allows you to change the settings on the board.
181
+
The program should establish a serial connection and reset the board to default settings. When a '-->' appears, you can type a character (character map http://docs.openbci.com/software/01-OpenBCI_SDK) that will be sent to the board using ser.write. This allows you to change the settings on the board.
89
182
90
183
A good first test is to try is to type '?':
91
184
>--> ?
@@ -112,15 +205,15 @@ Alternatively, there are 6 test signals pre configured:
112
205
113
206
The / is used in the interface to execute a pre-configured command. Writing anything without a preceding '/' will automatically write those characters, one by one, to the board.
114
207
115
-
For example, writing
116
-
> -->x3020000X
208
+
For example, writing
209
+
> -->x3020000X
117
210
will do the following:
118
211
119
212
‘x’ enters Channel Settings mode. Channel 3 is set up to be powered up, with gain of 2, normal input, removed from BIAS generation, removed from SRB2, removed from SRB1. The final ‘X’ latches the settings to the ADS1299 channel settings register.
120
213
121
214
Pre-configured commands that use the / prefix are:
122
215
123
-
test (As explained above)
216
+
test (As explained above)
124
217
125
218
> --> /test4
126
219
@@ -147,7 +240,7 @@ Serial established...
147
240
View command map at http://docs.openbci.com.
148
241
Type start to run. Type /exit to exit.
149
242
150
-
-->
243
+
-->
151
244
OpenBCI V3 8bit Board
152
245
Setting ADS1299 Channel Values
153
246
ADS1299 Device ID: 0x3E
@@ -200,17 +293,17 @@ Add new functionalities to user.py by creating new scripts inside the `plugins`
200
293
201
294
```python
202
295
import plugin_interface as plugintypes
203
-
296
+
204
297
classPluginPrint(plugintypes.IPluginExtended):
205
298
defactivate(self):
206
299
print"Print activated"
207
-
300
+
208
301
defdeactivate(self):
209
302
print"Goodbye"
210
-
303
+
211
304
defshow_help(self):
212
305
print"I do not need any parameter, just printing stuff."
213
-
306
+
214
307
# called with each new sample
215
308
def__call__(self, sample):
216
309
print"----------------"
@@ -243,7 +336,7 @@ You're done, your plugin should be automatically detected by `user.py`.
243
336
244
337
*`sample_rate`: Print effective sampling rate averaged over XX seconds (default: 10).
245
338
246
-
*`streamer_tcp`: Acts as a TCP server, using a "raw" protocol to send value.
339
+
*`streamer_tcp`: Acts as a TCP server, using a "raw" protocol to send value.
247
340
* The stream can be acquired with [OpenViBE](http://openvibe.inria.fr/) acquisition server, selecting telnet, big endian, float 32 bits, forcing 250 sampling rate (125 if daisy mode is used).
248
341
* Default IP: localhost, default port: 12345
249
342
@@ -269,3 +362,19 @@ Note: copy `open_bci_v3.py` there if you want to run the code -- no proper packa
269
362
*`test.py`: minimal example, printing values.
270
363
*`stream_data.py` a version of a TCP streaming server that somehow oversamples OpenBCI from 250 to 256Hz.
271
364
*`upd_server.py`*DEPRECATED* (Use Plugin): see https://github.com/OpenBCI/OpenBCI_Node for implementation example.
0 commit comments