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, 10, 7, 45), 'serial.Serial', 'serial.Serial', ({(7, 24, 7, 38): '"""/dev/ttyACM7"""', (7, 40, 7, 44): '9600'}, {}), "('/dev/ttyACM7', 9600)", False, 'import serial\n'), ((9, 12, 9, 23), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((10, 14, 10, 25), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((18, 4, 18, 28), 'matplotlib.pyplot.plot', 'plt.plot', ({(18, 13, 18, 27): 'sensorReadings'}, {}), '(sensorReadings)', True, 'import matplotlib.pyplot as plt\n'), ((19, 4, 19, 43), 'matplotlib.pyplot.ylabel', 'plt.ylabel', ({(19, 15, 19, 42): '"""EEG Sensor sensorReadings"""'}, {}), "('EEG Sensor sensorReadings')", True, 'import matplotlib.pyplot as plt\n'), ((20, 4, 20, 14), 'matplotlib.pyplot.show', 'plt.show', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((14, 18, 14, 29), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n')]