示例#1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from plotcat import plotter
import serial

ser = serial.Serial(sys.argv[1], sys.argv[2])
p = plotter()

data = []


@p.plot_self
def setval():
    data = [ser.readline() for i in range(100)]
    p.lines[0][0].set_data(p.currentAxis[0], data)

p.set_call_back(setval)
plotter.show()
示例#2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from plotcat import plotter
import sys
import serial
import time

if sys.version_info[0] < 3:
    import thread

else:
    import _thread as thread

ser = serial.Serial(sys.argv[1], sys.argv[2])
p = plotter(number_of_samples=1000)

data = [0 for i in range(0, 1000)]


def read_from_serial():

    while True:

        try:

            temp = ser.readline()
            try:

                data.append(int(temp))
                data.pop(0)
samples = 50

usbConnection = [
    "/dev/ttyUSB0", "/dev/ttyUSB1", "/dev/ttyUSB2", "/dev/ttyUSB3",
    "/dev/ttyUSB4"
]

data.append([0 for i in range(samples)])
data.append([0 for i in range(samples)])
data.append([0 for i in range(samples)])

p = plotter(number_of_samples=[samples, samples, samples],
            total_plots=3,
            rows=1,
            cols=3,
            y_low_lim=-2,
            y_high_lim=2,
            names='acceleration')


def stringCutter():

    global accelX, accelY, accelZ, orientation

    try:

        temp0 = str(ser.readline().strip())

        pos_f = temp0.index(',')
示例#4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from plotcat import plotter
import serial

ser = serial.Serial(sys.argv[1], sys.argv[2])
p = plotter()

data = []


@p.plot_self
def setval():
    data = [ser.readline() for i in range(100)]
    p.lines[0][0].set_data(p.currentAxis[0], data)


p.set_call_back(setval)
plotter.show()
import sys
import serial
import time

if sys.version_info[0] < 3:
    import thread

else:
    import _thread as thread

ser = serial.Serial('COM3', 9600)
p = plotter(number_of_samples=[1000, 200, 300, 400],
            total_plots=4,
            rows=2,
            cols=2,
            names=[
                "Sensor do Centro", "Sensor da Direita", "Sensor da Esquerda",
                "Sensor de Baixo"
            ],
            y_low_lim=0,
            y_high_lim=500)
data = []

data.append([0 for i in range(1000)])
data.append([0 for i in range(200)])
data.append([0 for i in range(300)])
data.append([0 for i in range(400)])


def read_from_serial():

    while True:
示例#6
0
# -*- coding: utf-8 -*-

from plotcat import plotter
import sys
import serial
import time

if sys.version_info[0] < 3:
    import thread

else:
    import _thread as thread


ser = serial.Serial(sys.argv[1], sys.argv[2])
p = plotter(number_of_samples=1000)

data = [0 for i in range(0, 1000)]


def read_from_serial():

    while True:

        try:

            temp = ser.readline()
            try:

                data.append(int(temp))
                data.pop(0)
# -*- coding: utf-8 -*-

from plotcat import plotter
import sys
import serial
import time

if sys.version_info[0] < 3:
    import thread

else:
    import _thread as thread


ser = serial.Serial(sys.argv[1], sys.argv[2])
p = plotter(number_of_samples=[1000, 200, 300, 400], total_plots=4, rows=2, cols=2, names="serial-graph")

data = []

data.append([0 for i in range(1000)])
data.append([0 for i in range(200)])
data.append([0 for i in range(300)])
data.append([0 for i in range(400)])




def read_from_serial():

    while True:
示例#8
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from plotcat import plotter
import serial
import random

p = plotter(figure=1)
p1 = plotter(figure=2)


@p.plot_self
def setval():
    data = [random.randint(0, 100) for i in range(100)]
    p.lines[0][0].set_data(p.currentAxis, data)


@p1.plot_self
def setval2():
    data = [random.randint(0, 100) for i in range(100)]
    p1.lines[0][0].set_data(p.currentAxis, data)


p.set_call_back(setval)
p1.set_call_back(setval2)

plotter.show()
示例#9
0
from plotcat import plotter
import sys
import serial
import time
import _thread as thread

#ser = serial.Serial('/dev/ttyACM0', 115200)
filne = "Datos.txt"
ser = open(filne, 'r+')
#print(ser)

p = plotter(number_of_samples=[1500, 1500, 1500, 1500],
            total_plots=4,
            rows=4,
            cols=1,
            names=["ECG", "EMG", "SPO2", "GSR"],
            y_low_lim=0,
            y_high_lim=1000)

data1 = [0 for i in range(0, 1500)]
data2 = [0 for i in range(0, 1500)]
data3 = [0 for i in range(0, 1500)]
data4 = [0 for i in range(0, 1500)]

##data.append([0 for i in range(1500)])
##data.append([0 for i in range(1500)])
##data.append([0 for i in range(1500)])


def read_from_serial():
示例#10
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from plotcat import plotter
import serial
import random

p = plotter(figure=1)
p1 = plotter(figure=2)

@p.plot_self
def setval():
    data = [random.randint(0,100) for i in range(100)]
    p.lines[0][0].set_data(p.currentAxis, data)

@p1.plot_self
def setval2():
    data = [random.randint(0,100) for i in range(100)]
    p1.lines[0][0].set_data(p.currentAxis, data)

p.set_call_back(setval)
p1.set_call_back(setval2)

plotter.show()
            except Exception as e:
                print(e)
                pass

        return func_wrapper

    @staticmethod
    def show():
        pylab.show()


ser = serial.Serial('/dev/ttyUSB0', 9600)
p = plotter(number_of_samples=[300, 300, 300, 300], 
            total_plots=4, 
            rows=4, 
            cols=1, 
            time_interval=5, 
            names=["ECG","EMG","SPO2","GSR"],
            y_low_lim=[0,0,0,0],
            y_high_lim=[1024,1024,1024,1024])


data1 = [0 for i in range(0,300)]
data2 = [0 for i in range(0,300)]
data3 = [0 for i in range(0,300)]
data4 = [0 for i in range(0,300)]


def read_from_serial():
    cont = 0

    while True: