int switchPin = 8;
int ledPin = 11;
int vvv = random(random(11));
const int analogPin = A0;   // the pin that the potentiometer is attached to
int old = 0;
int sensorReading;
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
boolean lastButton = LOW;
boolean currentButton = LOW;
boolean ledOn = false;
void setup(){
  lcd.init();                     
  lcd.backlight();
  lcd.print("display 1");
  lcd.setCursor(8, 1);
  lcd.print("test");
  pinMode(switchPin, INPUT);
	pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
  Serial.println(vvv);
}
boolean debounse(boolean last) {
	boolean current = digitalRead(switchPin);
	if(last != current) {
		delay(5);
		current = digitalRead(switchPin);
	}
	return current;
}

void loop() { 
  // read the potentiometer:
  sensorReading = analogRead(analogPin);
  // map the result to a range from 0 to the number of LEDs:
  if(old != sensorReading){
    lcd.setCursor(0, 1);
    lcd.clear();
    lcd.print(map(sensorReading, 0, 1023, 0, 10));
  }
  old = sensorReading;

  currentButton = debounse(lastButton);
 if(lastButton == LOW && currentButton == HIGH) {
  if(map(sensorReading, 0, 1023, 0, 10) > vvv){
  ledOn = true;
  }
}
	lastButton = currentButton;
	digitalWrite(ledPin, ledOn);  
}