int rLed = 11;
int gLed = 10;
int bLed = 9;
int resistorR = A1;
int resistorG = A2;
int resistorB = A3;
int valueR;
int valueG;
int valueB;
void setup() {
pinMode(rLed, OUTPUT);
pinMode(gLed, OUTPUT);
pinMode(bLed, OUTPUT);
pinMode(resistorR, INPUT);
pinMode(resistorG, INPUT);
pinMode(resistorB, INPUT);
}
void loop() {
valueR = analogRead(resistorR);
valueG = analogRead(resistorG);
valueB = analogRead(resistorB);
int conventRvalue = map(valueR, 0, 1023, 0, 255);
int conventGvalue = map(valueG, 0, 1023, 0, 255);
int conventBvalue = map(valueB, 0, 1023, 0, 255);
analogWrite(rLed, conventRvalue);
analogWrite(gLed, conventGvalue);
analogWrite(bLed, conventBvalue);
}