Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions buildhat/serinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def checksum(self, data):
u = (u ^ data[i]) & 0xFFFFFFFF
return u

def write(self, data, log=True, replace=""):
def write(self, data, log=False, replace=""):
"""Write data to the serial port of Build HAT

:param data: Data to write to Build HAT
Expand All @@ -259,7 +259,7 @@ def write(self, data, log=True, replace=""):
else:
logging.debug(f"> {data.decode('utf-8', 'ignore').strip()}")

def read(self):
def read(self, log=False):
"""Read data from the serial port of Build HAT

:return: Line that has been read
Expand All @@ -269,7 +269,7 @@ def read(self):
line = self.ser.readline().decode('utf-8', 'ignore').strip()
except serial.SerialException:
pass
if line != "":
if line != "" and log:
logging.debug(f"< {line}")
return line

Expand Down