Add a switch to your Arduino project with a ‘flip-flop’ node. XOD nodes overview.


Flip-flop is a XOD core node that outputs
a boolean value which is either true or false. You can switch the value by using the input pins. Use this node to switch between two states
of your electronic components such as LED, such as LED, motor, such as LED, motor, solenoid, or any other device. Take a look at the example. First of all, you need a circuit
with a couple of buttons on it and a LED which lights up
when one of the buttons is pressed. That’s how patch board look like. To avoid confusion,
give different names to the buttons. We named them “button on” and “button off.” Let’s extend this scheme. Let the first button turn the light on
and the second button turn the light off. It’s time to apply the “button off” node
and the “flip-flop” node. Link “SET” pin with the “button on” node, “RST” pin with “button off” node, output pin with a “LED” node
and deploy the patch. As you see, pressing the “button on”
sets the “true” state of the LED while pressing “button off”
sets the “false.” Additionally “flip-flop” node can
invert the stored value. Let’s figure out how it works
with a new example. Now, When we push the button the first time
we want LED to turn on, and when we push the second time
the LED should turn off. To make it work link the “TGL” input pin
with the “button on” node. “flip-flop” will change the state of our LED
every time you push the button. Upload patch to your board
to test how it works. It works! So our test is complete. “flip-flop” node is quite simple however it is often a component of other
complex XOD nodes with advanced functionality as “select”, or “flip-n-times”. So try “flip-flop”
making new nodes!

2 Comments

  • Would you consider adding support for ATtiny series built in? I believe it's currently possible but sort of hacky…

  • What would happen if the "on-button" is held down and then the "off-button" is pressed?
    Will nothing happen, will it turn off and on again or will it just turn off until the "on-button" is released and pressed again?

    In my case i want to trigger an event and the event might be over b4 the on-button is released.
    The event-finished trigger might be a trailing edge of a signal (via voltage detection)

Leave a Comment

Your email address will not be published. Required fields are marked *