Thank you for your reply!
i indeed had a lot of bloat-code there, further, using digitalWrite instead of analogWrite removed 99% of flickering :), here is my current code:
int leds[3] = {7, 8, 9};
int ledNr = 3;
int R = 6;
int B = 3;
int G = 5;
void setup() {
pinMode(R, OUTPUT);
pinMode(G, OUTPUT);
pinMode(B, OUTPUT);
for (int i = 0; i<ledNr; i++)
pinMode(leds[i], OUTPUT);
}
void drawLed(int led, int red, int blue, int green) {
digitalWrite(led, LOW);
digitalWrite(R, red);
digitalWrite(B, blue);
digitalWrite(G, green);
delay(1); // This is not neccecary, but increases the brightness significantly without making it flicker!
digitalWrite(R, 0);
digitalWrite(B, 0);
digitalWrite(G, 0);
digitalWrite(led, HIGH);
}
void loop() {
drawLed(leds[0], 0, 255, 0);
drawLed(leds[1], 255, 0, 0);
drawLed(leds[2], 0, 0, 255);
}