void setup() {
  // put your setup code here, to run once:
   Serial.begin(115200);
   pinMode(12, OUTPUT);
   delay(1000);


}

void loop() {
  // put your main code here, to run repeatedly:
  int v = analogRead(2);
  Serial.println(v);
  if(v>500)
  {
    digitalWrite(12, HIGH);
    Serial.println("Light On");
  }

  else 
  {
    digitalWrite(12,LOW);
    Serial.println("light off");
  }

}