const int LDRPIN=A0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(7, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
float value=analogRead(LDRPIN);
if(value>300)
{
digitalWrite(7, HIGH);
}
else
{
digitalWrite(7,LOW);
}
}