'P7' : 5, 'O1' : 6, 'O2' : 7, 'P8' : 8, 'T8' : 9,
                     'F8' : 10, 'AF4' : 11, 'FC6' : 12, 'F4' : 13 }

counter_to_sensor_id = [ 'F3', 'FC5', 'AF3', 'F7', 'T7', 'P7', 'O1',
                         'O2', 'P8', 'T8', 'F8', 'AF4', 'FC6', 'F4' ]


if __name__ == '__main__':

    # signal writer for storing samples
    sw = SignalWriter()
    sw.open('signal.csv')
    print("Signal writer is ready: %s" % sw.ready())

    # initialize the devices & buffer
    dev = EmotivDevice('SN20120229000254')
    dev.subscribe(sw.write_packet)
    dev.start_reader()

    # signal buffer for reading samples from the EEG
    eeg = SignalBuffer(750, 14)

    # PyGame subsystem init
    pygame.init()
    Clock = pygame.time.Clock()

    try:
        screen = pygame.display.set_mode((800, 600))

        myFont = pygame.font.SysFont("Ubuntu", 20, True)
import time

from emotiv_device import EmotivDevice
from emotiv_data_packet import EmotivDataPacket
from signal_buffer import SignalBuffer



if __name__ == '__main__':
    
    print("Setting up device ...")

    dev = EmotivDevice('SN20120229000254')
    
    print("Starting reader ...")

    dev.start_reader()

    rb = SignalBuffer(64, 14)
    
    for rbp in range(10):
        pp = rb.pull_packets(dev)
        print("Pulled %d packets." % pp)
        print rb.buffer().shape
        time.sleep(0.2)

    print("Stopping reader ...")

    dev.stop_reader()