Button toggle

Press once to latch the lamp on, press again to release it. A ready-made counters circuit you can open in the TorchAnvil simulator.

From momentary to persistent

A button is momentary. While you hold it, its output is high; the moment you let go, it's back to zero. That's fine for "fire a missile while I'm holding this," but useless for "keep the light on until I tell you otherwise."

A T flip-flop changes that. Each rising edge on its clock input flips Q — off becomes on, on becomes off. Wire a button to its clock and every press flips the lamp. Release the button and the lamp keeps whatever state it was just set to.

How it works

press # Q before Q after
1 0 1
2 1 0
3 0 1
4 1 0

Each press toggles. Holding the button doesn't re-fire — only the rising edge counts.

Why it matters

Every "press-to-turn-on" switch on a keyboard, every caps-lock-style indicator, every latching control in a mixer or DAW is built on this idea. Momentary inputs are cheap and reliable; persistent state is where the interesting behavior lives. The T flip-flop is the bridge.

Try this