Commit 18fc35a7 authored by Alisson Claudino's avatar Alisson Claudino

Corrigido Erro de escala de eixos

parent 1dff85df
...@@ -10,32 +10,28 @@ win = pg.GraphicsWindow() ...@@ -10,32 +10,28 @@ win = pg.GraphicsWindow()
p1 = win.addPlot() p1 = win.addPlot()
curve1 = p1.plot() curve1 = p1.plot()
readData = [0]
y1=[] y1=[]
x1=[] x1=[]
tim=[]
dt=0
t=time.time()
indx = 0 indx = 0
def update(): def update():
global curve1, indx, y1,x1,t,dt global curve1, indx, y1,x1
dt=time.time()-t
while (ser.inWaiting() == 0): while (ser.inWaiting() == 0):
pass pass
readData= float(ser.readline()) readData= float(ser.readline())
print(readData)
y1.append(readData) y1.append(readData)
x1.append(dt) print(readData)
if indx>50:
y1.pop(0)
x1.pop(0)
indx=0
else:
indx+=1 indx+=1
if len(y1)>99:
del y1[0]
indx=100
else:
x1.append(indx)
curve1.setData(x1,y1) curve1.setData(x1,y1)
p1.setXRange(0, 100, padding=0) p1.setXRange(0, 100, padding=0)
p1.setYRange(0,1023,padding=0)
app.processEvents() app.processEvents()
timer = QtCore.QTimer() timer = QtCore.QTimer()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment