Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 292.00,2436.00
- 292.00,2467.00
- 293.00,2498.00
- import serial
- import time
- import numpy as np
- entrada = serial.Serial('COM4', 4800)
- tempo_leitura = time.time() + 5 # Contador de 5 segundos
- geral = 0
- def leituraSerial():
- while(time.time() < tempo_leitura):
- geral = entrada.readline().decode()
- print(geral)
- time.sleep(0.01)
- return geral
- def conversorSerial():
- #único jeito que sei fazer é a partir de loadtxt(), que não creio ser o caso, tentei diversas maneiras, porém não nenhuma obteve sucesso. Outra dúvida é o retorno do .decode() é uma string correto?
Add Comment
Please, Sign In to add comment