Skip to content

Instantly share code, notes, and snippets.

@yudanta
Created February 9, 2015 08:54
Show Gist options
  • Save yudanta/033d0b32b3a5d8c9571a to your computer and use it in GitHub Desktop.
Save yudanta/033d0b32b3a5d8c9571a to your computer and use it in GitHub Desktop.
connecting mindwave
import mindwave, time
headset = mindwave.Headset('/dev/tty.MindWaveMobile-DevA', '8FA4')
time.sleep(5)
headset.connect()
print "Connecting..."
#print headset.status
#print headset
#print headset.rawValue()
'''
while headset.status != 'connected':
print headset.status
time.sleep(0.5)
if headset.status == 'standby':
headset.connect()
print "Retrying connect..."
print "Connected."
'''
while True:
time.sleep(0.5)
print "Attention: %s, Meditation: %s" % (headset.attention, headset.meditation)
print headset.raw_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment