from pyemotiv import Epoc import matplotlib.pyplot as plt import matplotlib.animation as animation import time, config import numpy as np import csv fig = plt.figure() ax = fig.add_subplot(1, 1, 1) nScan=0 epoc = Epoc() t=[] sensor={} for name in config.SENSORNAME: sensor[name]=[] start_time=time.time() def countdown(self): #waiting print "scan in 3 seconds" time.sleep(1) print "scan in 2 seconds" time.sleep(1) print "scan in 1 seconds" time.sleep(1) def animate(i,t,sensor,data):
from pyemotiv import Epoc import numpy as np from gzp import save import time """ Sample Emotiv experiment. Gathers data over two phases. Use a keyboard interrupt (control-c) to end a phase. Saves data to disk afterwards. """ headset = Epoc() data = headset.get_raw() times = headset.times t0 = time.time() print "First phase..." while True: #first phase (eg. 'resting') try: x = headset.get_raw() t = headset.times data = np.concatenate((data, x), axis=1) times = np.concatenate((times, t), axis=-1) except KeyboardInterrupt: break breaktime = times[-1]