I have a bunch of LEDs (all the same part number / specification) that I want to light up using a shift register. The trouble is, each output bit should control a different number of LEDs (depending on the bit, any of 2, 3 or 4 LEDs). Regardless, every individual LED should be equally bright.
IIUC, just feeding the LEDs their forward voltage... isn't recommended.
I suppose I could pair every single LED with a resistor and feed them 5V, with a FET to switch each group, but that's a lot of resistors. (And I do need one per LED, because one per group will cause the remainder to cook if one of the group goes open-circuit.) I know constant-current drivers exist, but I'm not familiar with their use, and the amount of current is highly variable. Another (not-ideal) option would be to use the same number of LEDs but "hide" some of them somehow (or maybe use a non-light-emitting diode with the same voltage drop?) so every group needs the same current.
What's the most "efficient" (in terms of power used, cost, and fewest components) way to accomplish this?
I'm not wedded to the shift register if there's an array driver that can cope with different current per channel and provides a way to update 32 channels concurrently¹. I am hoping for something that only needs two wires to drive it, however, and ideally can accept a full array update in 40 bits or less.
(¹ "Daisy-chaining" serial-input 8- or 16-bit controllers is fine as long as the output changes 'all at once'.)
p.s. If your answer involves a driver, please also explain how to either set the per-channel current to 2X, 3X or 4X, or where to find a driver that can handle ~15V (since most recommend no more than ~6V).