Python module to stream BITalino data though the Lab Streaming Layer (LSL)
Project description
BITalino-lsl
A python module called bitalino_lsl to stream BITalino data though the Lab Streaming Layer (LSL). This module gets data from the BITalino device through the bitalino python api and uses the Lab Stream Layer to stream the data.
The module should work with python versions >= 2.7 although it has only been tested for:
- Python 2.7.15
- Python 3.6.5
Getting started
Installation
pip install bitalino_lsl
Example
import bitalino_lsl
from pylsl import StreamInlet, resolve_stream
import time
# MAC address of the BITalino device
MAC_ADDRESS_BITALINO_DEVICE = "20:17:11:1A:2B:3C"
# List with channels of the BITalino device to be streamed to the LSL
# This channels can be specified as a list or as a dictionary with their
# position in the 10-20 system. BITalino uses bipolar electrodes so the
# position will be defined by two points
# CHANNELS = {0: 'Fp1-Fp2', 1: 'P3-T5'}
CHANNELS = [0,1]
# Connect with the BITalino device
device = bitalino_lsl.BitalinoLSL(MAC_ADDRESS_BITALINO_DEVICE)
# Create the Stream with the channels information
device.create_lsl_EEG(CHANNELS)
# Start the stream getting data from the BITalino device
device.start()
# Get the Stream to read the data from
inlet = StreamInlet(resolve_stream('type', 'EEG')[0])
# Read the BITalino data for 5 seconds
t_end = time.time() + 5
while time.time() < t_end:
sample, timestamp = inlet.pull_sample()
print(sample)
# Stop the device
device.stop()
# Close the connection with the BITalino device
device.close()
Documentation
Documentation is available here
License
This project is licensed under the GNU GPL v3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bitalino_lsl-0.0.3.tar.gz.
File metadata
- Download URL: bitalino_lsl-0.0.3.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d5d781cbef6b051ffc20eb559a793483d742cc3ccf6ba07d8edd579ed036bae
|
|
| MD5 |
41065b86267fd37bd598bea757ac9082
|
|
| BLAKE2b-256 |
95a66b42530a9880cf6c13579c13aabfc4bbccf6bf136abd7abf8c0ac0c69c5e
|
File details
Details for the file bitalino_lsl-0.0.3-py3-none-any.whl.
File metadata
- Download URL: bitalino_lsl-0.0.3-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cf484b180ba8b8d777445b599deec0ff520f38e4afcc01de9b16f9bf64a7936
|
|
| MD5 |
85df1d498e34279ce08498286a0fddfc
|
|
| BLAKE2b-256 |
84d5d96b7bc1ebbf039398e033053c7140c4345702ce89225bdacd7d02c16744
|