# we're quitting mon.stop() dev.stop_reader() pygame.quit() sys.exit(0) if __name__ == '__main__': # init the pygae subsystem pygame.init() display = pygame.display.set_mode((1000,700), 0) # init the device & monitor mon = EmotivDeviceMonitor() dev = EmotivDevice('SN20120229000254') # moje # dev = EmotivDevice('SN20120229000348') # jarovo # create the main GUI window rootwidget = WaveRiderGUI(display) # check the device status mon.check_connected() mon.start() # execution does not reach past the run() function rootwidget.run()
import time from emotiv_device_monitor import EmotivDeviceMonitor from emotiv_device import EmotivDevice def print_event(connected): print(connected) dev = EmotivDevice('SN20120229000254') mon = EmotivDeviceMonitor() mon.callbacks.append(print_event) mon.start() time.sleep(10.0) mon.stop()