const int pinRed = 11, pinGreen = 10, pinBlue = 9;

int potMerah, potHijau, potBiru;

void setup() {
  Serial.begin(9600);
  pinMode(pinRed, OUTPUT);
  pinMode(pinGreen, OUTPUT);
  pinMode(pinBlue, OUTPUT);
}

void loop() {
  potMerah = analogRead(A0);
  potHijau = analogRead(A1);
  potBiru = analogRead(A2);

  LEDRGB(potMerah, potHijau, potBiru);

  delay(200);
}

void LEDRGB(int red, int green, int blue){
  analogWrite(pinRed, red);
  analogWrite(pinGreen, green);
  analogWrite(pinBlue, blue);
}