int value;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Hello, ESP32!");

}

void loop() {
  // put your main code here, to run repeatedly:
  value = analogRead (A3);
  int readValue;             //value read from the sensor
  int maxValue = 0;          // store max value here
  int minValue = 1024;          // store min value here
  
  Serial.print("Input was :") ;
  Serial.println (value);

  if (value < 504 or value > 520) {
    Serial.println ("One eighty");
    myservo.write (180);
    delay(1500);
  }

  if (value > 504 and value < 520) {
    Serial.println("Zero");
    myservo.write (0);
    delay(1500);
  }

}