This bug/stupidity-of-myself/problem is killing me:
I'm have created an RGB strip controller that cycles through the additive-rgb-color spectrum while turning a potentiometer.
I have a pot hooked up to my Arduino Nano v3 (from AZ-Delivery, not official Arduino). Then I have an RGB amplifier hooked up to the Arduino with each phase (R, G, B, V+) and to an external power supply (12V by 2A max).
I shortened my program and removed all the value-to-colour-conversion because that has nothing to do with the problem:
void loop() {
ColorVal = analogRead(pinPot); //read value of color poti
ColorByte = map(ColorVal, 0, 1023, 0, 255); //Scales 0-1023 to 0-255
// potvalue to color conversion
// ...
// write via PWM to LED
analogWrite(pinR, R);
analogWrite(pinG, G);
analogWrite(pinB, B);
}
My problem: Theoretically you would expect the system to show white when all variables (R, G and B) are set to 255. However, it behaves the other way around. When all values are set to 255 it's off and vice versa. Another example: When R = 255 and G = 0 and B = 0 Green and Blue are lighting and Red is off.
I thought this has to do with polarity or something but I cannot seem to find it out.