Syrostan-MCU-C/plot_adc.py

14 lines
287 B
Python
Raw Normal View History

length = 16384
import serial
import numpy as np
import matplotlib.pyplot as plt
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=None)
buffer = ser.read(length);
data = []
for i in range(length):
data.append(np.int8(buffer[i]))
# print(data)
plt.plot(data)
plt.show()
ser.close()