
#define analog_sensor A0  // select the input pin for the potentiometer 
int ledPin = 15;          // select the pin for the LED , GPIO15 >>>  D10
int analogValue ;         // value from the annlog input pin 
void setup () 
{ 
  pinMode (ledPin, OUTPUT);
  pinMode (analog_sensor, INPUT);
  Serial.begin (115200);
}
 void loop ()
 { 
  analogValue=analogRead(analog_sensor);
  Serial.println(analogValue);
  if (analogValue > 512) 
  { 
    digitalWrite (ledPin, HIGH);
    delay(50); 
  }else
  { 
    digitalWrite (ledPin, LOW);
    delay(10); 
  }
}
