Skip to content

Commit d64cff1

Browse files
authored
Merge pull request #39 from dglaude/patch-1
Update matrix_11x7.py
2 parents a85d015 + e11b25b commit d64cff1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

adafruit_is31fl3731/matrix_11x7.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,4 @@ def __init__(self, i2c, address=0x75):
4242
@staticmethod
4343
def pixel_addr(x, y):
4444
"""Translate an x,y coordinate to a pixel index."""
45-
if x <= 5:
46-
r = x * 16 + y
47-
else:
48-
r = (x - 5) * 16 + y - 8
49-
return r
45+
return (x << 4) - y + (6 if x <= 5 else -82)

0 commit comments

Comments
 (0)