int ldrPin = A0;
int ledPin= 9;
int val = 0;
void setup() {
pinMode(ldrPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}

void loop() {
int val = analogRead(ldrPin);
Serial.println(val);

if(val == HIGH ){
digitalWrite(ledPin, HIGH);

}
else{
digitalWrite(ledPin, LOW);

}
}