//Costanti
const int RED = 3;
const int GREEN = 2;
const int BLUE = 1;
const int WAIT = 1000;
const int pt1 = A1;
const int pt2 = A2;
const int pt3 = A3;
//Variabili
int VALR = 0;
int VALG = 0;
int VALB = 0;
//Codice
void setup()
{
pinMode(RED, OUTPUT);
pinMode(GREEN, OUTPUT);
pinMode(BLUE, OUTPUT);
pinMode(pt1, INPUT);
pinMode(pt2, INPUT);
pinMode(pt3, INPUT);
}
void loop()
{
VALR = analogRead(pt1);
VALR = map(VALR, 0, 1023, 0,255);
VALG = analogRead(pt2);
VALG = map(VALG, 0, 1023, 0,255);
VALB = analogRead(pt3);
VALB= map(VALB, 0, 1023, 0,255);
analogWrite(RED, VALR);
analogWrite(GREEN, VALG);
analogWrite(BLUE, VALB);
}