#define PINBLUE 3
#define PINGREEN 4
#define PINRED 5
#define ADCBLUE 28
#define ADCGREEN 27
#define ADCRED 26
void setup() {
// put your setup code here, to run once:
pinMode(PINBLUE, OUTPUT);
pinMode(PINGREEN, OUTPUT);
pinMode(PINRED, OUTPUT);
pinMode(ADCBLUE, INPUT);
pinMode(ADCGREEN, INPUT);
pinMode(ADCRED, INPUT);
}
int readPot(int pin){
return map(analogRead(pin), 0, 1023, 0, 255);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(PINBLUE, readPot(ADCBLUE));
analogWrite(PINGREEN, readPot(ADCGREEN));
analogWrite(PINRED, readPot(ADCRED));
}