From 009ff7b62507712b598db71232abfaf9f4170c47 Mon Sep 17 00:00:00 2001 From: sandyjmacdonald Date: Wed, 24 Feb 2021 22:40:51 +0000 Subject: [PATCH 1/4] Swapping order of R and G LEDs, using board defined pins. --- adafruit_is31fl3731.py | 4 ++-- examples/is31fl3731_keybow_2040_rainbow.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index bc1a1c3..7fb695c 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -506,8 +506,8 @@ def pixelrgb(self, x, y, r, g, b, blink=None, frame=None): """ x = x + (4 * y) - super().pixel(x, 0, r, blink, frame) - super().pixel(x, 1, g, blink, frame) + super().pixel(x, 0, g, blink, frame) + super().pixel(x, 1, r, blink, frame) super().pixel(x, 2, b, blink, frame) # pylint: disable=inconsistent-return-statements diff --git a/examples/is31fl3731_keybow_2040_rainbow.py b/examples/is31fl3731_keybow_2040_rainbow.py index 5042797..02ddabf 100644 --- a/examples/is31fl3731_keybow_2040_rainbow.py +++ b/examples/is31fl3731_keybow_2040_rainbow.py @@ -62,7 +62,7 @@ def hsv_to_rgb(hue, sat, val): return (val, p, q) -i2c = busio.I2C(board.GP5, board.GP4) +i2c = busio.I2C(board.I2C()) # Set up 4x4 RGB matrix of Keybow 2040 display = adafruit_is31fl3731.Keybow2040(i2c) From eabcf8600a344738f3d941acc6355c15f48e5beb Mon Sep 17 00:00:00 2001 From: sandyjmacdonald Date: Wed, 24 Feb 2021 22:51:36 +0000 Subject: [PATCH 2/4] Correcting I2C setup in Keybow rainbow example. --- examples/is31fl3731_keybow_2040_rainbow.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/is31fl3731_keybow_2040_rainbow.py b/examples/is31fl3731_keybow_2040_rainbow.py index 02ddabf..92088a1 100644 --- a/examples/is31fl3731_keybow_2040_rainbow.py +++ b/examples/is31fl3731_keybow_2040_rainbow.py @@ -18,7 +18,6 @@ import time import math import board -import busio import adafruit_is31fl3731 @@ -62,7 +61,7 @@ def hsv_to_rgb(hue, sat, val): return (val, p, q) -i2c = busio.I2C(board.I2C()) +i2c = board.I2C() # Set up 4x4 RGB matrix of Keybow 2040 display = adafruit_is31fl3731.Keybow2040(i2c) From 137e45ee36fa0d137ebd9115ec2a8c9ef012bd95 Mon Sep 17 00:00:00 2001 From: sandyjmacdonald Date: Thu, 25 Feb 2021 16:51:52 +0000 Subject: [PATCH 3/4] Flipping order of LEDs to match switch numbers. --- adafruit_is31fl3731.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index 7fb695c..b2986f1 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -504,7 +504,7 @@ def pixelrgb(self, x, y, r, g, b, blink=None, frame=None): :param blink: True to blink :param frame: the frame to set the pixel """ - x = x + (4 * y) + x = 15 - (x + (4 * y)) super().pixel(x, 0, g, blink, frame) super().pixel(x, 1, r, blink, frame) From 193f6c3b70514f1fc57c8e7381fc51d8b794d947 Mon Sep 17 00:00:00 2001 From: sandyjmacdonald Date: Thu, 25 Feb 2021 22:27:34 +0000 Subject: [PATCH 4/4] Oh boy. I got the x/y coordinates wrong AGAIN. --- adafruit_is31fl3731.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_is31fl3731.py b/adafruit_is31fl3731.py index b2986f1..6ee32c7 100644 --- a/adafruit_is31fl3731.py +++ b/adafruit_is31fl3731.py @@ -504,7 +504,7 @@ def pixelrgb(self, x, y, r, g, b, blink=None, frame=None): :param blink: True to blink :param frame: the frame to set the pixel """ - x = 15 - (x + (4 * y)) + x = (4 * (3 - x)) + y super().pixel(x, 0, g, blink, frame) super().pixel(x, 1, r, blink, frame)