Short of digital pins!!

Hi, i'm working in a project with Arduino Mega:

16 Pots (Analog inputs)... OK

3 encoders with touch, 26 Digital input (touch buttons), total: 35 (Digital)

36 LEDs. (36 Digital)

The problem:
I'm short of digital outputs for the leds, whats the best solution?

Easy - a chain of four TBIC6B595 requires three pins to control.

Oh great, i should say that some leds sometimes must be blinking, on, and off. Theres is no problem with that can i control each led individually?

I can get the 74hc595 is it the same?

Sorry about the dumb questions i'm new in all this.

No, 74xx595 is logically the same but has much more limited current capability. You would need to limit your leds to around 8mA each. Would that be bright enough?

I am surprised Paul__B did not suggest max7219 for your leds. Did i miss something? One max7219 can run up to 64 leds and needs only 3 digital outputs from the Arduino.

Paul (not the same Paul!)

Oh, i think it will be better, i can get only one with the leds on it:

But, i can take out the leds anyway.

Than you both!

PaulRB:
I am surprised Paul__B did not suggest max7219 for your leds. Did i miss something? One max7219 can run up to 64 LEDs and needs only 3 digital outputs from the Arduino.

Hah! You caught me there!

I was thinking that he might want some serious current to drive the LEDs, so I mentioned the TPIC to "cover all bases". If they are only indicators, then a MAX7219 certainly is the go.

OK, if you have - or are getting - one of those boards which is virtually as cheap as the chip alone and the easiest way to wire it up, then assemble all except the headers that mount the matrix; just solder those connections to the matrix you have made of the LEDs you have. If you are making a permanent assembly, leave out the pins for the interface and solder those as well.

Did I say four octal shift registers? 36 LEDs - of course that would not be sufficient.

For 36 (or 40) LEDs, you use five columns or "digits" - that is, the first five cathode or digit driver lines only, and set up the Scan Limit register for five so you get maximum multiplex time for each.

A MAX7219 is arguably easier to drive than a string of octal shift registers (xxx595s) as you only need to address the particular register you wish to change, not all at once.

There's no need to put resistors between the max's output pins and the leds? Is it correct?

That is correct. The MAX7219 uses one resistor to control the max current per output, and the intensity register to divide it down further.
I offer a breakout board so you can easily connect to individual LEDs:
http://www.crossroadsfencing.com/BobuinoRev17/