//const int LEDpin=12;
//const int photoPIN=A0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A0, INPUT); //status of LDR
pinMode(12, OUTPUT); // Street Light
}
void loop() {
// put your main code here, to run repeatedly:
int x= analogRead(A0);
if(x<200){
digitalWrite(12, LOW); //Street Light must be ON
Serial.println("It is BRIGHT ");
}
else{
digitalWrite(12, HIGH);
Serial.println("It is DARK");
}
}