i get this error:
LDR_Simple.ino:18: error: 'LDRValue' cannot be used as a function
if (LDRValue()==1)Serial.println ("On");
^
exit status 1
'LDRValue' cannot be used as a function
my code:
int LDRPWR = 16;
int LDRPin = 5; // select the input pin for LDR
int LDRValue = 0; // variable to store the value coming from the sensor
void setup() {
pinMode(LDRPWR, OUTPUT);
Serial.begin(9600); //sets serial port for communication
digitalWrite(LDRPWR, LOW);
}
void loop() {
//LDRValue = analogRead(LDRPin); // read the value from the sensor
digitalWrite(LDRPWR, HIGH); // sets the LDR on
delay(1000); // waits for a second
LDRValue = digitalRead(LDRPin); // read the value from the sensor
digitalWrite(LDRPWR, LOW); // sets the LDR off
// delay(1000); // waits for a second
Serial.println(LDRValue); //prints the values coming from the sensor on the screen
if (LDRValue()==1)Serial.println ("On");
}