Individual dimming on 8x8 red matrix

Hello,

I'm starting a small project with a max7219 and a 8x8 red led matrix, using LedControl library.
I was wondering if there would be a way to control the intensity of LEDs one by one, instead of setting a global intensity as it is available by default in the library? (I mean being able to have one LED to intensity 2, another set to intensity 8 etc...)
Or is there a limitation in the way a LED matrix works?

Thanks and regards,
Michael

Max7219 only supports global brightness control.
If you want one dimmer, set the level for the unit, then write the ones you want dimmer to be on/off a different rate, effectively making software PWM for them. Use blink without delay to control how long they are off and on.

Hello, and thank you for your answer.
But I'm not sure I got your point, could you elaborate a little more? :slight_smile:

Thanks!
Michael

The MAX7219 has 8 data register to write to that each control the on/off state of 8 LEDs.
If you write data of 0b11111111 to address 1, that will turn on a column of LEDs.
If you write data of 0b00000000 to address 1, all LEDs in that column will be off.
So if you write 0b11111111 and 0b11111110, say every 2mS, then the 1 LED that is changing will be look to be dimmer than the 7 that are not.
So you can use "blink without delay" style code to watch for the passage of 2mS, and turn on/off the LEDs that you want dimmer. If you want multiple brightness levels, them maybe 2mS on and 4mS off, or 6mS off. You can play with different times & ratios to achieve the look you want.
Need to keep in mind that the MAX7219 is also multipexing at 800 Hz, so a column is only on for 1.25mS, and then off for 8.75mS (times not confirmed, but derived from statements in the datasheet) and you have no way to sync up with that.

ok, it's clear now, I'll try this out!! :slight_smile:

Thanks a lot for your help!

Hi Bob, have you actually made this arrangement work? It would mean attempting to multiplex something that is already multiplexed and, as you pointed out, you can't synchronise the two. I can imagine all sorts of flickering going on due to the lack of synchronisation between the Arduino and the '7219, so it will be interesting to know if it does work.

No, I have never tried it. Haven't had that need.