int led = 3;
int pot = A0;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int value = analogRead(pot);
int bright = map(value,0, 1023 ,0 , 255);
analogWrite(led,bright);
Serial.println(bright);
}