One output, reacting to many inputs.

guix:
Problem is that you reassign the same variable "floodSensorState", so it's value will always be the value of digitalRead(floodSensor3) (since it is the last assignment).

You could do something like that:

if ( digitalRead(floodSensor1) || digitalRead(floodSensor2) || digitalRead(floodSensor3) )

{
  // turn LED on:    
  digitalWrite(ledPin, HIGH);  
}
else
{
 // turn LED off:
 digitalWrite(ledPin, LOW);
}




|| mean "or"


It is also possible, if all the floor sensors are on the same PORT, to check if the corresponding bits of that port are set, with only a few bitwise operations. Which Arduino do you use?

Thats fantastic thank you!! I goggled for an Arduino or function and drew a blank!! Can you recommend an where I can start looking up stuff like this? I tried using the word or where you put the bars like in VB? and nothing happened :frowning: