//Nome: Estrela José Marcolino
#define PINRED 5
#define PINGREEN 4
#define PINBLUE 3
#define ADCRED 28
#define ADCGREEN 27
#define ADCBLUE 26
void setup() {
pinMode(PINRED, OUTPUT);
pinMode(PINGREEN, OUTPUT);
pinMode(PINBLUE, OUTPUT);
pinMode(ADCRED, INPUT);
pinMode(ADCGREEN, INPUT);
pinMode(ADCBLUE, INPUT);
}
int readpot(int pin){
return map(analogRead(pin),0 ,1023, 0, 255);
}
void loop() {
analogWrite(PINRED, readpot(ADCRED));
analogWrite(PINGREEN, readpot(ADCGREEN));
analogWrite(PINBLUE, readpot(ADCBLUE));
}