Skip to content

Commit 0fc8faf

Browse files
author
frankalicious
committed
add debug output in i2c array writing
1 parent 2a5469f commit 0fc8faf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Adafruit_PWM_Servo_Driver/Adafruit_I2C.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ def writeList(self, reg, list):
3939
"Writes an array of bytes using I2C format"
4040
try:
4141
self.bus.write_i2c_block_data(self.address, reg, list)
42+
if (self.debug):
43+
print("I2C: Wrote %s to register 0x%02X" %
44+
(' '.join('0x%02X' % (i) for i in list), reg))
4245
except IOError, err:
4346
print "Error accessing 0x%02X: Check your I2C address" % self.address
4447
return -1

0 commit comments

Comments
 (0)