#define led 18
#define pot 26

void setup() {

  pinMode(led, OUTPUT);
  pinMode(pot, INPUT);
  // put your setup code here, to run once:
  
}

void loop() {
  // put your main code here, to run repeatedly:
  int value=analogRead(pot);
  int valuepot=map(value,0,1023,0,255);
  if(valuepot<128)
  digitalWrite(led, LOW);
  else
  digitalWrite(led, HIGH);
  
  delay(500); // this speeds up the simulation
}