Simple question...
I have a TX module I am sending to an RX board.
I simply want to push a button once to latch a Relay "ON", then push the same button again to turn the relay "OFF".
Yes my modules are working fine... I just need help with this simple brain teaser.
I was thinking of adding + 1 to a variable with a initial condition of zero... each time the button is pushed then divide it down to an even or odd number. If odd the relay stays high, if even the relay if off.
Basically I am making a simple state machine. I should know this but have not messed with state logic in a while.
Could I use toggle to do this more simply?