Skip to content
Snippets Groups Projects

Apsct production

2 files
+ 23
17
Compare changes
  • Side-by-side
  • Inline

Files

+ 4
4
@@ -55,7 +55,7 @@ class I2C:
return ret_ack, ret_value
def read_last_reg(self, bytes_to_read):
def read_last_reg(self, bytes_to_read, print_on = DEBUG):
bus = smbus.SMBus(self.bus_nr)
rd_value = []
ret_value = ''
@@ -68,12 +68,12 @@ class I2C:
except IOError:
ret_ack = 0
rd_value.append(0)
if DEBUG:
print("Reading error")
if print_on:
print(f"Reading IOerror {rd_value}")
except err:
ret_ack = 0
rd_value.append(0)
if DEBUG:
if print_on:
print("Reading error")
for cnt in range(bytes_to_read):
ret_value += (hex(rd_value[cnt])[2:])
Loading