Fixed Uart serial stuff
This commit is contained in:
parent
7f4eae67f6
commit
e44a78742e
1 changed files with 2 additions and 1 deletions
|
@ -5,7 +5,7 @@ class Mhz19Co2:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.last_read = None
|
self.last_read = None
|
||||||
|
|
||||||
self.serial_port = "/dev/tty.usbserial-B001BTPZ"
|
self.serial_port = "/dev/serial0"
|
||||||
self.baud_rate = 9600
|
self.baud_rate = 9600
|
||||||
self.byte_size = 8
|
self.byte_size = 8
|
||||||
self.parity = "N"
|
self.parity = "N"
|
||||||
|
@ -18,6 +18,7 @@ class Mhz19Co2:
|
||||||
return self.last_read
|
return self.last_read
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
|
ser = None
|
||||||
try:
|
try:
|
||||||
ser = serial.Serial(
|
ser = serial.Serial(
|
||||||
port=self.serial_port,
|
port=self.serial_port,
|
||||||
|
|
Loading…
Reference in a new issue