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