import pygame, sys from numpy import * from pygame.locals import * import scipy from pymindwave.pyeeg import bin_power pygame.init() fpsClock= pygame.time.Clock() window = pygame.display.set_mode((1280,720)) pygame.display.set_caption("Mindwave Viewer") from pymindwave.parser import Parser p = Parser('/dev/ttyUSB0') blackColor = pygame.Color(0,0,0) redColor = pygame.Color(255,0,0) greenColor = pygame.Color(0,255,0) deltaColor = pygame.Color(100,0,0) thetaColor = pygame.Color(0,0,255) alphaColor = pygame.Color(255,0,0) betaColor = pygame.Color(0,255,00) gammaColor = pygame.Color(0,255,255) background_img = pygame.image.load("sdl_viewer_background.png") font = pygame.font.Font("freesansbold.ttf",20)
#core.checkPygletDuringWait = False typy_triali=[] ile_triali=50 for i in range(ile_triali): triale_cyfry.append(random.choice(cyfry)) if random.random()<szansa_spojnego: typy_triali.append('spojny') triale_napisy.append(napisy[triale_cyfry[-1]]) else: typy_triali.append('niespojny') zbior_zubozony=napisy_set-set([napisy[triale_cyfry[-1]]]) triale_napisy.append(zbior_zubozony.pop()) p = Parser('/dev/rfcomm0') okienko=visual.Window(units='pix',winType='pygame',fullscr=True) intro=visual.TextStim(win=okienko,text='Nastepna cyfra to...',color='black',height=50,pos=(0,100)) napis=visual.TextStim(win=okienko,color='black',height=50,pos=(0,-100)) cyfra=visual.TextStim(win=okienko,color='black',height=100,pos=(0,0)) dobrze=visual.TextStim(win=okienko,text=': )',color='green',height=100,pos=(0,0)) zle=visual.TextStim(win=okienko,color='red',text= ': <',height=100,pos=(0,0)) odczyty=[] odpowiedzi=[] okienko.setMouseVisible(False) for i in range(ile_triali): levele=[] wektory=[]
#!/usr/bin/env python from psychopy import visual, core, event from pymindwave.parser import Parser import random import pickle import datetime p = Parser('/dev/rfcomm0') for i in range(5): levele = [] wektory = [] atencje = [] medytacje = [] blinki = [] jakosci = [] core.wait(0.5) # p.update() levele.append(p.raw_values[-1]) wektory.append(p.current_vector) atencje.append(p.current_attention) medytacje.append(p.current_meditation) blinki.append(p.current_blink_strength) try: jakosci.append(p.poor_signal) except AttributeError: jakosci.append(666) core.wait(0.5)