byte ledPin = 7;
byte Potensio = A0;
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop()
{
int analogSignal = analogRead(Potensio);
int brightness = map(analogSignal, 0, 1023, 0, 255);
analogWrite(ledPin, brightness);
Serial.print("analogSignal= ");
Serial.println(analogSignal);
Serial.print("PWM signal= ");
Serial.println(brightness);
delay(1000);
}