Is this:
Sbit key=P2 ^ 5;
Bit key_error=0;
If (key_error & amp; & Key)
{
delay_ms(10);
If (key)
{
Execute statement;
}
}
When the button pressed, P2 ^ 5 grounding, my question is on the if the judgment of the conditions, key_error & amp; & What is the result of the key?
My understanding is:
Key_error=0;
Button press key also to 0,
Lust after the result is 0,
Namely the if (0 & amp; & 0),
So do not perform the following statement!
I think if the judgment of the conditions should be like this:
If (key_error==0 & amp; & Key==0)
If (key==0)
Just say pass!
But if (key_error==0 & amp; & Key==0) and the if (key_error & amp; & Key), the difference is very big still, heck is wrong with son
Also please bosses some directions,
CodePudding user response:
The building Lord you understand is rightCodePudding user response:
Key_error and see if it is in other places have changed, this here is most meaningful, such as can do a gate, let go, to test keyLook at this a few words in fact don't see what, according to the passage, in order to know the process if you have any questions
CodePudding user response:
Cannot be taken out of context, if someone else is written like that, it must be useful, and the establishment of the judgment condition must be 2 to 1 conditions was established, perhaps his buttons do not connect power grounding unknown?CodePudding user response: