const int LED1 {2};
int const LED2 {6};
const int LED3 {12};
int const POT_PIN {14};
int ledwrite {1};

void setup() {
  // put your setup code here, to run once:
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  


while (true) {

  int pot_pin_tal = analogRead(POT_PIN);

  int delaytid = map(pot_pin_tal, 0, 1023, 600, 50);

  delay(delaytid);
  
  if (ledwrite == 1) ledwrite = 0; else ledwrite = 1;

  if (pot_pin_tal > 100) digitalWrite(LED1, ledwrite);
                  else digitalWrite(LED1, LOW);

  if (pot_pin_tal > 600) digitalWrite(LED2, ledwrite);
                  else digitalWrite(LED2, LOW);

  if (pot_pin_tal > 850) digitalWrite(LED3, ledwrite);
                  else digitalWrite(LED3, LOW);
}              
}