HELP ME ,PLZ.

if ( 11 == HIGH && 4 == HIGH && dly<= 500 )

{ digitalWrite(11,LOW); digitalWrite(8,HIGH); delay(100);}

else { digitalWrite(7, HIGH); delay(100); digitalWrite(7, LOW);}

HI, I have a big problem with that.

i have pin 11 as binary output.
pin 8 as digital output.
pin 7 as condition output.
pin 4 as digital input.

the issu is wen i push the button 4 the statement do not exute it self.

HELP ME ,PLZ,PLZ,PLZ.

if “11” & “4” are output pins, you can not use in this place. Those should be input or the boolean variable where you can store input/output/constant values.

if ( 11 == HIGH && 4 == HIGH && dly<= 500 )

Note: better assign name for each and every pin and use in code.

if ( 11 == HIGH

That's never going to happen, is it?

The IDE has many very basic examples of programming supplied.
I suggest you read through a few.

perhaps not

if ( 11 == HIGH . . .

but

if ( digitalRead( 11 ) == HIGH . . .

perhaps not

if ( 11 == HIGH . . .

but

if ( digitalRead( 11 ) == HIGH . . .

This also can not happen as the pin is defined as ouput pin and we try to read as digital input pin. This contradicts.

britto:
perhaps not

if ( 11 == HIGH . . .

but

if ( digitalRead( 11 ) == HIGH . . .

This also can not happen as the pin is defined as ouput pin and we try to read as digital input pin. This contradicts.

Does it?

Does it?

Its working. Sorry for the untested assumption before.

If the pin is an output then presumably the program sets it HIGH or LOW. Save this state in a variable when you do the digitalWrite() to the pin and use it later when you need to know the current state. No need for digitalRead() at all.

thnks, everybody.