int potPin=A5;
int ledPin=0;
int potVolt;
float ledValue;
void setup() {
// put your setup code here, to run once:
pinMode(potPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
potVolt = analogRead(potPin);
ledValue = (255./1023)*potVolt;
analogWrite(ledPin,ledValue);
Serial.println(ledValue);
}