Skip to content

Instantly share code, notes, and snippets.

@fnielsen
Created December 9, 2013 15:29
Show Gist options
  • Save fnielsen/7873982 to your computer and use it in GitHub Desktop.
Save fnielsen/7873982 to your computer and use it in GitHub Desktop.
Simplest EEG reader
# This example is close to the example provide by the emokit module.
from emokit import emotiv
import gevent
headset = emotiv.Emotiv()
gevent.spawn(headset.setup)
gevent.sleep(1.5)
try:
while True:
packet = headset.dequeue()
print("{:5} {:5}".format(packet.sensors["O1"]["value"],
packet.sensors["O2"]["value"]))
gevent.sleep(0)
finally:
headset.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment