int pot1 = A0;
int pot2 = A1;
int pot3 = A2;
int r = A3;
int g = A4;
int b = A5;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(pot1, INPUT);
pinMode(pot2, INPUT);
pinMode(pot3, INPUT);
pinMode(r, OUTPUT);
pinMode(g, OUTPUT);
pinMode(b, OUTPUT);
Serial.println("RED\tGREEN\tBLUE");
}
void loop() {
// put your main code here, to run repeatedly:
int value1 = analogRead(pot1);
int value2 = analogRead(pot2);
int value3 = analogRead(pot3);
int map1 = map(value1, 0, 1023, 0, 255);
int map2 = map(value2, 0, 1023, 0, 255);
int map3 = map(value3, 0, 1023, 0, 255);
Serial.print(map1);
Serial.print("\t");
Serial.print(map2);
Serial.print("\t");
Serial.println(map3);
analogWrite(r, map1);
analogWrite(g, map2);
analogWrite(b, map3);
delay(1000);
}