Today we’ll turn the toggle logic into a state machine. The homework you brought in already tracks whether the button was down last time around the loop; that variable is a state, and the pattern built on it is the finite state machine, which both Lab 2 design challenges need. We’ll start by reading each other’s toggle code, then write the same logic as a state diagram and as C, then design two machines of our own on paper and implement one of them.