Skip to content

Commit e501a26

Browse files
author
K. Townsend
committed
I2C fix plus PWM support
1 parent b99d5df commit e501a26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Adafruit_I2C/Adafruit_I2C.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def write8(self, reg, value):
1818
try:
1919
self.bus.write_byte_data(self.address, reg, value)
2020
if (self.debug):
21-
print("I2C: Wrote 0x%02X to device 0x%02X" % (self.address, reg))
21+
print("I2C: Wrote 0x%02X to register 0x%02X" % (value, reg))
2222
except IOError, err:
2323
print "Error accessing 0x%02X: Check your I2C address" % self.address
2424
return -1
@@ -28,7 +28,7 @@ def readU8(self, reg):
2828
try:
2929
result = self.bus.read_byte_data(self.address, reg)
3030
if (self.debug):
31-
print "I2C: Device 0x%02X returned 0x%04X from reg 0x%02X" % (self.address, result & 0xFF, reg)
31+
print "I2C: Device 0x%02X returned 0x%02X from reg 0x%02X" % (self.address, result & 0xFF, reg)
3232
return result
3333
except IOError, err:
3434
print "Error accessing 0x%02X: Check your I2C address" % self.address
@@ -39,7 +39,7 @@ def readS8(self, reg):
3939
try:
4040
result = self.bus.read_byte_data(self.address, reg)
4141
if (self.debug):
42-
print "I2C: Device 0x%02X returned 0x%04X from reg 0x%02X" % (self.address, result & 0xFF, reg)
42+
print "I2C: Device 0x%02X returned 0x%02X from reg 0x%02X" % (self.address, result & 0xFF, reg)
4343
if (result > 127):
4444
return result - 256
4545
else:

0 commit comments

Comments
 (0)