BCIduino社区|基于pylsl接收BCIduino的脑肌电数据

首先要安装pylsl,在cmd中运行:

pip install pylsl

安装好之后,运行以下python代码可以接收BCIduino通过lsl发出来的数据

"""Example program to show how to read a multi-channel time series from LSL."""

from pylsl import StreamInlet, resolve_stream

# first resolve an EEG stream on the lab network
print("looking for an EEG stream...")
streams = resolve_stream('type', 'EEG')

# create a new inlet to read from the stream
inlet = StreamInlet(streams[0])

while True:
    # get a new sample (you can also omit the timestamp part if you're not
    # interested in it)
    sample, timestamp = inlet.pull_sample()
    print(timestamp, sample)

在这里插入图片描述
运行之后就会看到命令行中打印出了相应的脑肌电数据和时间戳。
在这里插入图片描述

#本篇由BCIduino脑机接口开源社区原创/转载(公众号“BCIduino脑机接口社区”)。BCIduino脑机接口社区由来自北京航空航天大学、康奈尔大学、北京大学、首都医科大学等硕博发起成立,欢迎扫下面码加入社群,也欢迎采购BCIduino脑电模块和外骨骼等(某宝搜索即可或者扫码详询)。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/nvsirgn/article/details/108993849