From a0cf4c1d53029b89d6a9d5de3ffad8c0b1e35f88 Mon Sep 17 00:00:00 2001 From: Gijs <schoonderbeek@astron.nl> Date: Tue, 18 Oct 2022 17:15:01 +0200 Subject: [PATCH] Update for APSPU production --- I2C_serial_pi2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/I2C_serial_pi2.py b/I2C_serial_pi2.py index 5deb512..f85dc66 100644 --- a/I2C_serial_pi2.py +++ b/I2C_serial_pi2.py @@ -77,8 +77,10 @@ class I2C: def write_bytes(self, register, data): bus = pi.i2c_open(self.bus_nr, self.I2C_Address) + if type(data) is not list: + data = [data] try: - pi.i2c_write_i2c_block_data(bus, register, [data]) + pi.i2c_write_i2c_block_data(bus, register, data) ret_ack = 1 if SLOW: sleep(0.3) -- GitLab