You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to rewrite below python code in flutter/dart. I would like to how to set port,baudrate,parity,bytesize and open readline connection?
import time
import serial
import re
ser = serial.Serial(
port='/dev/ttyS0',
baudrate=115200,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.SEVENBITS,
)
ser.isOpen()
out = ''
for i in range(10):
waitingQueue = ser.inWaiting()
if waitingQueue == 0:
weight = "-- kg"
else:
out = ser.readline()
if out != '':
print(str(out))
m = re.search('\s\s(.+?)\s\s\s\s', str(out))
if m != None:
weight = m.group(1)
else:
weight = "Extract Error"
print(weight.strip())
ser.close()
The text was updated successfully, but these errors were encountered:
I am trying to rewrite below python code in flutter/dart. I would like to how to set port,baudrate,parity,bytesize and open readline connection?
The text was updated successfully, but these errors were encountered: