Void loop works once, then it goes random

ryukenden:
the serial output below.

looks OK, perhaps post a photo of your rig.

I'd test it with a single LED on each of the 6 PWM pins, first.

it looks like only pins 3 and 5 are working in this code.
using just a singulair led to test.

Im testing the code now on a breadboard and by usb power on the pc.

ryukenden:
it looks like only pins 3 and 5 are working in this code.
using just a singulair led to test.

Im testing the code now on a breadboard and by usb power on the pc.

can you post a photo?

The breadboard layout.

    analogWrite(pin, pwmValue);

Shouldn't it be

    analogWrite(pwmPins[pin], pwmValue);

Gabriel_swe:

    analogWrite(pin, pwmValue);

Shouldn't it be

    analogWrite(pwmPins[pin], pwmValue);

yes that worked, now they are all going one by one!

The code works perfectly on the breadboard now, thank you Bulldog and Gabriel for your time and effort.
sad part is that it still has the random error on the standalone.

I guess it is a hardware fault somewhere. Maybe the adapter does not supply stable enough power so the signal gets messed up?

Gabriel_swe:

    analogWrite(pin, pwmValue);

Shouldn't it be

    analogWrite(pwmPins[pin], pwmValue);

good eye!!

ryukenden:
The breadboard layout.

I don't see any current limiting resistors. You may have blown some outputs.

aarg:
I don't see any current limiting resistors. You may have blown some outputs.

the outputs are still working fine despite no resistors.
on the breadboard it all works perfectly, just when its on the standalone atmega its not working.

ryukenden:
the outputs are still working fine despite no resistors.

No, it is not working fine. It is unreliable. It is running on luck.

aarg:
No, it is not working fine. It is unreliable. It is running on luck.

he meant that the PWM driving the prototype board is OK.

The important stuff we haven't seen...
what is attached to these 6 outputs in the actual device?

hundreds of LEDs makes me think of many possible issues.

Hey guys,

the problem has been solved!
i put in a diffrent 5 volt regulator and now its working perfectly.
seems the power was too unstable coming in.

Thank you all for your time, effort and insight!