0
Hello, Good Night, today I came up with another problem, reading data generated by sensors of the Arduino, I was able to print them and save them in an array, but to really get good, I need to break the two separate columns, as in the example
292.00,2436.00
292.00,2467.00
293.00,2498.00
But I can’t create a file. CSV, to save and then take it again just to convert into two array, wanted to do this in the python code itself
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):
np.geral = entrada.readline().decode()
print(np.geral)
time.sleep(0.01)
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?
How so break the two separate columns? The values come together by serial and you need to separate them?
– Woss