jremington:
Do you have a current limit resistor on each LED?At 20 mA/LED, 40 LEDs on at once could exceed the total current limit of the Mega, and the Mega voltage regulator will probably overheat.
Thanks.... I'm actually using a MOS FET boards which have a LED and limiting resister.
Sketch will not have more than 5 LEDs firing at one time.