]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Add & Remove spaces to clean the syntax
authorSimon-Pierre Allaire <spallaire@distech-controls.com>
Wed, 7 Oct 2020 18:37:20 +0000 (14:37 -0400)
committerSimon-Pierre Allaire <spallaire@distech-controls.com>
Wed, 7 Oct 2020 18:37:20 +0000 (14:37 -0400)
examples/mcps_busio_i2c.py

index 6a64c5c92d0ca3a367282ae8f980dedfa0d5c92b..2059354320e593384adb6f78b0ca7a381fa12dc3 100755 (executable)
@@ -14,7 +14,7 @@ class MCP2221(_MCP2221):
     def __init__(self, address):
         self._hid = hid.device()
         self._hid.open_path(address)
-        print("Connected to "+str(address))
+        print("Connected to " + str(address))
         self._gp_config = [0x07] * 4  # "don't care" initial value
         for pin in range(4):
             self.gp_set_mode(pin, self.GP_GPIO)  # set to GPIO mode
@@ -42,7 +42,7 @@ for addr in addresses:
         i2c_device = I2C(MCP2221I2C(MCP2221(addr)))
         i2c_devices.append(i2c_device)
     except OSError:
-        print("Device path: "+ str(addr)+ " is used")
+        print("Device path: " + str(addr) + " is used")
 
 
 while True:
@@ -50,8 +50,8 @@ while True:
         addrbuf = bytearray(2)
         addrbuf[0] = ADDRID1 >> 8
         addrbuf[1] = ADDRID1 & 0xFF
-        inbuf  = bytearray(6)
+        inbuf = bytearray(6)
         i2c.writeto_then_readfrom(MLXADDR, addrbuf, inbuf)
-        print("Device "+str(i2c_devices.index(i2c))+": ")
+        print("Device " + str(i2c_devices.index(i2c)) + ": ")
         print(inbuf)
         time.sleep(0.5)