Skip to content

neopixel.brightness does not take effect with auto_write or show() #49

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

Closed
FoamyGuy opened this issue Mar 14, 2020 · 1 comment
Closed
Labels

Comments

@FoamyGuy
Copy link
Contributor

This issue stems from a user in the #help-with-circuitpython discord channel. It was originally noticed on a Feather Cricket, which is also how I've done the testing on it. But I believe I've narrowed the behavior down to the seesaw library, if this issue would be more appropriate on the crickit library though let me know and I can move it to there.

It seems that changing neopixel.brightness does not take effect when auto_write is True or even when show() is called.

It does take effect after you call fill() or on each pixel when you set it's color individually. Even if you are setting them to the same color they are already on.

This code illustrates the behavior:

import time
from adafruit_crickit import crickit

PIXELS = 30
crickit.init_neopixel(PIXELS)
crickit.neopixel.fill((0,0,255))
time.sleep(1) # showing full brightness
crickit.neopixel.brightness = 0.02
crickit.neopixel.show()
time.sleep(1) # still showing full brightness here

for i in range(0,10):
    crickit.neopixel[i] = (0,0,255)
time.sleep(1) # now the first 10 are dim

crickit.neopixel.fill((0,0,255))
# now they are all dim

Looking at the brightness setter code here it appears to be checking auto_show and calling show() as if the expectation is that this would update the brightness.

I am guessing that an ultimate fix for this would need to be made inside the seesaw firmware. But I'm not certain.

Aside from changing the seesaw firmware I am wondering if either of these two options are acceptable resolutions:

  1. Change the brightness setter at the python layer to "manually" set each pixel back to it's current color in order to force the brightness change. I assume this would cost some compute time, but would make it take effect without the end user having to worry about it.

  2. Document the current behavior in the docs and/or comment code within this library and the crickit library (and any others that it may be applicable to if there are any). This would let people know how the brightness is expected to behave

@kattni kattni added bug and removed bug labels May 4, 2020
@kattni kattni added the bug label May 15, 2020
@jfurcean
Copy link
Contributor

jfurcean commented Jun 8, 2021

This should be fixed by #72.

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

No branches or pull requests

3 participants