Detect change of state - boolean logic
mojorizing
Posts: 249
Help me out here.....
to detect a change of state (xstate) on a prop pin it would be the following code for low to high...
what is the logic to detect a change from high to low?
oldstate, newstate, and xstate refer to the states of 4 adjacent pins wired to 4 push buttons held high, going low when pressed.
I could use a bitwise not to invert inputs, but is there other way? I'm cross-eyed from working out truth tables.
to detect a change of state (xstate) on a prop pin it would be the following code for low to high...
xstate := newstate ^ oldstate & newstate ' detect change of bits, 0->1
what is the logic to detect a change from high to low?
oldstate, newstate, and xstate refer to the states of 4 adjacent pins wired to 4 push buttons held high, going low when pressed.
I could use a bitwise not to invert inputs, but is there other way? I'm cross-eyed from working out truth tables.
Comments
-Phil
Thanks, Phil