title

mail@pastecode.io avatar
unknown
python
a month ago
734 B
3
Indexable
Never
import time

from NeuroPy.NeuroPy import NeuroPy
neuropy = NeuroPy("COM5", 9600)
def attention_callback(attention):
    print("Attention", attention)

def meditation_callback(meditation):
    print("Meditation", meditation)

def raw_callback(raw):
    print("raw", raw)

def delta_callback(delta):
    print("Delta", delta)

def theta_callback(theta):
    print("Theta", theta)


#REGISTER CALLBACKS
neuropy.setCallBack("attention", attention_callback)
neuropy.setCallBack("meditation", meditation_callback)
neuropy.setCallBack("rawValue", raw_callback)
neuropy.setCallBack("delta", delta_callback)
neuropy.setCallBack("theta", theta_callback)
time.sleep(5)
neuropy.start()
while True:
    time.sleep(0.1)
Leave a Comment