/* Potenciómetro que varía el brillo de un LED */
int PinPot = A0;
int PinLed = 11;
int ledBrightness;
int sensorValue = 0;
void setup()
{
pinMode(PinLed, OUTPUT);
}
void loop()
{
sensorValue = analogRead(PinPot);
ledBrightness = map(sensorValue, 0, 1023, 0, 255);
analogWrite(PinLed, ledBrightness);
}