Dimming 4 LEDs with 1 PWM pin

My latest project required the use of two timer interrupts so that made four of the PWM pins unavailable. My 4 daylight readable status LEDs became spotlights at night so not dimming them was not an option. To keep the code simple I found this Texas Instruments AND gate IC. ($2.78 at Digi-Key, see attachment) One input of each AND is connected to a PWM pin and each of the other inputs is connected to an output pin on the Arduino. So I analogWrite the PWM value to the pin that controls half of all the AND gates, then when one of the non-PWM pins goes high, the PWM signal is transferred to the output pin on the AND.

To keep the code simple I found this Texas Instruments AND gate IC. ($2.78 at Digi-Key

Wow - that chip should be less than $0.50

You may be mistaking this TI SN74AS1008A for a garden variety 7408 which can only sink a much lower current.

Looks like a UDN2981 with an AND input for each.
Don't feel antagonized, but you're advocating.
What's the V_OH with your example at 10mA, 20mA, 30mA, 40mA?

http://www.ti.com/lit/ds/symlink/sn74as1008a.pdf

slong88:
You may be mistaking this TI SN74AS1008A for a garden variety 7408 which can only sink a much lower current.

In your circuit you are not sinking any current only souring it.

You could have simply used the first N-type transistor that you could find… Connect the Emitter/Source to GND and PWM the base(+resistor)/gate of that. And instead of connecting all the leds to ground connect them to the collector/drain. Should cost you <10 cents…

Heck, you could even do it without is you would stay under a total led current of 40mA (which is doable with modern leds). One end of each led to a single PWM pin and the other end to another pin.