Why I do not get a syntax error in code line digitalWrite (waterPumb, LOW),
ι end this code line using comma, not using semicolon as usual.
const int analogPin = A0; // pin that the humidety sensor is attached to
const int waterPumb = 13; // pin that the water valve is attached to
const int threshold = 500; // an arbitrary threshold level that's in the range of the analog input
void setup() {
pinMode(waterPumb, OUTPUT); // initialize the water valve pin as an output:
Serial.begin(9600); // initialize serial communications:
}
void loop() {
int analogValue = analogRead(analogPin); // read the value of the potentiometer:
if (analogValue < threshold) {digitalWrite (waterPumb, HIGH); } //if the analog value is low enough, turn on the waterPumb
delay(10000);
digitalWrite (waterPumb, LOW), //turn on the waterPumb
Serial.println(analogValue); // print the analog value
delay(20000); // delay in between reads
}