const int pinR=6;
const int pinB=5;
const int pinG=3;
const int potR=A0;
const int potB=A1;
const int potG=A2;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(pinR,OUTPUT);
  pinMode(pinB,OUTPUT);
  pinMode(pinG,OUTPUT);
  pinMode(potR, INPUT);
  pinMode(potB, INPUT);
  pinMode(potG, INPUT);
}
int ReadPotMess(int pot)
{
  
  return map(analogRead(pot),0,1023,0,255);
}
void loop() {
  // put your main code here, to run repeatedly:
  analogWrite(pinR,ReadPotMess(potR));
  analogWrite(pinB,ReadPotMess(potB));
  analogWrite(pinG,ReadPotMess(potG));
}