//Entrada Analogica Potenciometro

void setup()
{
 Serial.begin(9600);  //LED
 pinMode(7,OUTPUT);  //Potenciomtro
 pinMode(A0,INPUT);
}

void loop()
{
 int a = analogRead(A0);
 int x = map(a,0,1024,0,255);
 Serial.print(x);
 analogWrite(7,x);
}