import numpy as np
import serial
import time
import matplotlib.pyplot as plt

def getData():
    ser = serial.Serial('/dev/ttyACM7', 9600)
    sensorReadings = []
    start = time.time()
    current = time.time()
    while current - start < 10:
        data =ser.readline()
        sensorReadings.append(float(data))
        current = time.time()
    return sensorReadings

def plotter(sensorReadings):
    plt.plot(sensorReadings)
    plt.ylabel('EEG Sensor sensorReadings')
    plt.show()

if __name__ == '__main__':
    sensorReadings = getData()
    plotter(sensorReadings)

[(7, 'serial.Serial', 'serial.Serial', False, 'import serial\n'), (9, 'time.time', 'time.time', False, 'import time\n'), (10, 'time.time', 'time.time', False, 'import time\n'), (18, 'matplotlib.pyplot.plot', 'plt.plot', True, 'import matplotlib.pyplot as plt\n'), (19, 'matplotlib.pyplot.ylabel', 'plt.ylabel', True, 'import matplotlib.pyplot as plt\n'), (20, 'matplotlib.pyplot.show', 'plt.show', True, 'import matplotlib.pyplot as plt\n'), (14, 'time.time', 'time.time', False, 'import time\n')]