sst00:
I was wondering whether it woks with outputs like thisif(ledpin == HIGH && ledpin2 == HIGH) {
digitalWrite(ledpin3, HIGH);
}
else {
digitalWrite(ledpin3, LOW);
You're missing some digitalRead()s in there I think.
"ledpin" and "ledpin2" appear to be variable names. So you are comparing the contents of the variable "ledpin" to the macro "HIGH". Not the state of the pin referred to by "ledpin".
So in other words, your if statement could read like:
int ledpin = 2; // example of bad variable name
int ledpin2 = 3; // example of a REALLY bad variable name
if ((ledpin == HIGH) && (ledp2in == HIGH))
// becomes
if ((2 == HIGH) && (3 == HIGH)) // this will never evaluate true, because
// actually evaluates as
if ((2 == 1) && (3 == 1)) // clearly, can't be true.