Ok, so i'm having a really awkward problem here... I recently build a Pool light, that has 5 3W RGB LEDs that are all individually controlled by 15 PWM Pins on an Arduino Mega 1280, since each LED had 4 pins, and instead of all Cathodes (-), all Anodes (+) where connected together (i figured this is probrally for when you want/need to control the RGB Pins with Transistors, since Transistors usually control ground), the brightness i've got from the Arduino Pins directly (witch are limited to about 40 mA) was enough for my, or lets say i didn't think it was worth it to have to use 15 Transistors and on top of that even have to heat sink the LEDs, anyhow, since i wanted them to PWM fade the LEDs between different colors i connected the + pin from each LED to 5V and each - pin to a digital pin (witch supports PWM of course), and since the 0 to 255 brightness in this case was obviously inverted since i was controlling the - poles instead of the + poles, i just did something like analogWrite(pin, map(brightness, 0, 255, 255, 0)); witch works fine...
Now to the problem (sorry for the long explanation), i've noticed that the color of one LED was often a little different from others after observing and testing things for a while i found out that the Green of that LED was allways a little weaker then the Green of the others, i tried changing the pins and found out that even if i only connect two LEDs (any LEDs, small, big, there was no difference) to 5V, pin 2 and 5V, pin 3, and upload this sketch:
void setup() {
analogWrite(2, 150);
analogWrite(3, 150);
}
void loop() {
}
the LED on pin 2 always glows brighter than the LED on pin 3, i've also tried digitalWrite(2 and 3, LOW); and got the same results except of course both LEDs where brighter, what is even stranger is that in both examples this doesn't occur when i try the same thing connecting the LEDs to GND, pin 2 and pin 3, in that case both LEDs allwas have same brightness.
Another thing i found strange about pin 3 was that all other Pins while uploading something and before setting the pin high or low or 'analog'Writing something to it are not high or low, they are just not connected to anything (by the way, i always wondered if it is possible to bring a pin back to that state once it was set to something, it could be useful sometimes, something like digitalWrite(pin, NEUTRAL); is that possible? I assume it isn't) but pin 3 while uploading and before setting it is low, however it is not as low as possible if you set it low it gets a bit lower but the LED in the pool (or any other LED) connected to pin 3 does glow before i set it HIGH in the setup(), thats all i found out until now...
Does anybody know why this could be, and if it is possible to "fix"?
Thanks, Delphiño