rm-hull / luma.led_matrix

Python module to drive LED Matrices & 7-segment displays (MAX7219) and RGB NeoPixels (WS2812 / APA102)
https://luma-led-matrix.readthedocs.io
MIT License
516 stars 159 forks source link

Adding brightness/contrast parameter to max7219 init method #207

Closed snarkywolverine closed 4 years ago

snarkywolverine commented 4 years ago

Can contrast level be an optional parameter on the constructor for the max7219?

I have a script that re-inits and updates the display every so often; every time it runs, I see a brief 'flash' where the contrast is raised before my code can lower it again. If contrast was an optional parameter, I could eliminate that "flashing".

rm-hull commented 4 years ago

Yep that seems a good feature request (and simple to implement)

rm-hull commented 4 years ago

1.4.1 released to PyPI with this change

RikJm commented 3 years ago

Hi, great work on the luma.led_matrix! I am learning heaps thanks to what you guys have put together. It's incredible.

I don't know if this is the right place to ask this, can the contrast level be modified in a per "pixel" LED basis on the max7219?

I see that the neopixels have an alpha value but I couldn't find anything similar on the max7219. I tried the dither but it doesn't really work when drawing on (x,y)

Thanks again for such an incredbile library!

rm-hull commented 3 years ago

@RikJm no, there is no provision for setting the brightness of individual pixels on the max7219 chip. It may be possible to send a series of byte sequences very quickly to simulate different brightness levels much like PWM, but you would have to do that in C or maybe using DMA. Python certainly won't be quick enough I don't think.