//Using potentiometer as analog sensor//
//The objective is to vary the brightness of LED//
int pot;
int led;
void setup() {
// put your setup code here, to run once:
pinMode(13,OUTPUT);
pinMode(A0,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
pot = analogRead(A0);
led = map(pot, 0, 1023, 0 ,255);
analogWrite(13,led);
}