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)

[((109, 144), 'serial.Serial', 'serial.Serial', (['"""/dev/ttyACM7"""', '(9600)'], {}), "('/dev/ttyACM7', 9600)\n", (122, 144), False, 'import serial\n'), ((183, 194), 'time.time', 'time.time', ([], {}), '()\n', (192, 194), False, 'import time\n'), ((210, 221), 'time.time', 'time.time', ([], {}), '()\n', (219, 221), False, 'import time\n'), ((424, 448), 'matplotlib.pyplot.plot', 'plt.plot', (['sensorReadings'], {}), '(sensorReadings)\n', (432, 448), True, 'import matplotlib.pyplot as plt\n'), ((454, 493), 'matplotlib.pyplot.ylabel', 'plt.ylabel', (['"""EEG Sensor sensorReadings"""'], {}), "('EEG Sensor sensorReadings')\n", (464, 493), True, 'import matplotlib.pyplot as plt\n'), ((499, 509), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (507, 509), True, 'import matplotlib.pyplot as plt\n'), ((348, 359), 'time.time', 'time.time', ([], {}), '()\n', (357, 359), False, 'import time\n')]