int ledPin = 5;
int potensioPin = 4;
int val = 0;
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
val = analogRead(potensioPin);
analogWrite(ledPin, val / 4);
Serial.println(val);
}