Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shifting inverts red and green pixels on bi-color 8x8 matrix #102

Closed
MakerThornhill opened this issue Aug 4, 2022 · 6 comments
Closed

Comments

@MakerThornhill
Copy link

I'm using a 8x8 bi-color matrix with the HT16K33 Led Backpack on a QTPY RP2040 running CircuitPython 7.3.2 (2022-07-20).

I'm noticing red and green LEDs invert when shifting pixels by an odd amount. There's also an inconsistency between green and red when using the fill() method and when changing the colour of individual pixels.

My code below highlights this behaviour (although it also occurs with the ht16k33_matrix_simpletest).

import board
import time
from adafruit_ht16k33.matrix import Matrix8x8x2

i2c = board.I2C()
matrix = Matrix8x8x2(i2c)

matrix.fill(1) # 1 should be red, but it sets all pixels green
matrix[0, 0] = 1 # Makes the 1st pixel red

time.sleep(1)
matrix.shift_up() # Shifts pixels up 1, colours are inverted so red = green, green = red
time.sleep(1)
matrix.shift_up() # Shifts pixels up 1, colours are inverted so red = green, green = red
time.sleep(1)
matrix.shift(0,2) # Shifts pixels up 2, colours remain the same
time.sleep(1)
matrix.shift(0,3) # Shifts pixels up 3, colours are inverted again so red = green, green = red

@makermelissa
Copy link
Contributor

Huh, interesting. That could be a bug that's been there a while that just needs to have the method overridden for that class.

@BlitzCityDIY
Copy link
Contributor

hello, I was testing with the new STEMMA version of the bicolor 8x8 matrix and noticed the identical behavior reported by @MakerThornhill above. I tested with a QT Py RP2040 and a Feather M4 on CP 8.0.2 stable. To make sure it wasn't my wiring, I tested with both boards with the Arduino library and the matrix behaved as expected.

BlitzCityDIY added a commit that referenced this issue Feb 20, 2023
Swapping the _set_buffer() parameters so that when the matrix is filled it shows the proper color. This fixes part of issue #102. Tested with a QT Py RP2040 running CP8 and an 8x8 BiColor matrix

I tried working on shifting to get the color to remain as expected but that's a little over my head at the moment. Also changing two ValueError() strings to f strings per pylint
@makermelissa
Copy link
Contributor

Fixed via #113

@BlitzCityDIY
Copy link
Contributor

hihi @makermelissa my PR actually only fixed the issue with color being flipped for calling matrix.fill(). The issue is still present with matrix.shift(). I wasn't able to make progress there

@BlitzCityDIY BlitzCityDIY reopened this Feb 21, 2023
@makermelissa
Copy link
Contributor

Whoops, thanks for reopening.

BlitzCityDIY added a commit that referenced this issue Mar 11, 2024
This fixes the color swapping during shift() as noted in #102
@BlitzCityDIY
Copy link
Contributor

this is fixed with #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants