There is only two possible conditionsView attachment 196190
Your diagram is the same as mine.
What you see is the simplest case of the 4x4 switch matrix interface.
This is what you have to work with.
Tell me how you understand the functioning and coding for this circuit.
void main ()
{
if ( P1 == High)|| (P2 == High)
Button pressed
else
Switch button not pressed
}
We are waiting for the TS to discover these things on his own.Hint: If they are both inputs, you won't detect anything...
If they are both inputs, won't they be"floating?"Hint: If they are both inputs, you won't detect anything...
Your circuit diagram is incomplete. You did not say which pin is the input and which is the output.Ignore your most recent circuit diagram. We are not discussing that.
This is your problem. Try to understand how to make this work. This is your challenge.
Exactly. This is your challenge to figure out.Your circuit diagram is incomplete. You did not say which pin is the input and which is the output.
Yes. But what happens when S1 is not pressed?I am assuming P1 is output pin and P2 input pin
View attachment 196447
When P1 is low and if we press the switch, P2 will also low
When P1 is high and if we press the switch, P2 will also high
Design engineers make 'choices'. You were given the challenge to make it work, not make it work "this way".Your circuit diagram is incomplete. You did not say which pin is the input and which is the output.
When P1 is low and if we do not press the switch, P2 will also lowYes. But what happens when S1 is not pressed?
This is where you make a common assumption that is wrong.When P1 is low and if we do not press the switch, P2 will also low
When P1 is low and if we press the switch, P2 will also low
When P1 is high and if we press the switch, P2 will also high
When P1 is high and if we do not press the switch, P2 will also low
by Jake Hertz
by Duane Benson