int ldr_s = A0;
void setup() {
Serial.begin(9600);
pinMode(ldr_s, INPUT);
// put your setup code here, to run once:
}
void loop() {
int Sensor_v=analogRead(ldr_s);
Serial.print("voltage : ");
Serial.println(Sensor_v);
if(Sensor_v < 500)
{
digitalWrite(6, HIGH);
}
else{
digitalWrite(6, LOW);
}
delay(2000);
// put your main code here, to run repeatedly:
}