Flip flop toggeling

hi,
i was following this video


but i didnt understand how he uses the toggle in flip flop to make the led once on once off with one button, in the info its said toggle converts the stored value, this means if the input 1 makes 0 and if 0 makes it 1…but how is this used to make the output always 1 when press the button then always off when press the button again ?
1 Like

Have you gone through the built-in tutorial? 010-flip-flop shows an example for using flip-flop. If you want to control an LED, replace the watch node with an “led” node using flip-flop-MEM to control led-LUM. Replace the clock node with a button node, and you have the circuit you are asking about.

3 Likes

as a circuit it worked like in video , but its just I didnt understand how it worked (the principal ) for the second case which is once on then once off with the same button…so it worked for me but I didnt understand how it works cause I didnt understand why the toggle in flip flop is used to make the led once on then once off with one button, in the info of the flip flop its said toggle converts the stored value, this means if the input (button) 1 makes output of flip flop (mem) 0 and if input(button) 0 makes output of flip flop (memory)1…but how could this work to make the output always 1 when press the button then always off when press the button again

1 Like

The flip-flop input pins only change the output when they are pulsed. If you feed a Boolean value to the pin, it only changes the output value when the input value changes from false to true (there is an implies pulse-on-true node to convert Boolean to pulse). This means if you connect a button to flip-flop-TGL, the flip-flop will toggle each time the button is pressed (changes to true). Holding the button keeps it true, releasing the button changes it to false, both of which are ignored by the flip-flop.

The “toggle changes 0 to 1 and 1 to 0” is in reference to the output, not the input. If the output is 1 when the TGL pin is pulsed, output will change to 0.

3 Likes

nice…thank you so much