In this lecture, I'll show you how to use the button, so it's a very simple device, obviously, but
it's a little tricky to get it to work in a way that a momentary button, at least, is supposed to
work.
So let me demonstrate.
I'm going to place the button in the same tab and group as the one that we used in the previous lecture
where we played with a text input and output.
So first I'm going to pick a button from the dashboard category of nodes.
There it is right here.
And to show us the state of the button, I'm simply going to use a text output node and connect the
two directly like that.
Let's have a look inside the button edit tab and you'll see that for the group.
I'm going to assign it to have one group, one for this size.
Let's make it three by one to begin with and see if that fits with the rest of the widgets in the group.
And I also want to give it an icon, a hand I can hinter pointing down for the label.
Just going to type in.
Press me like that, and I'm going to leave the color and background, actually for the color.
I'm going to make it blue.
I'm going to have a blue background blue button in white background.
Now, when I click on the button, I want the button to send the text clicked to whatever follows in
these cases, the text output node and click on done for the text output.
Again, I'm going to assign the text output again to tab one group one, although I can assign it to
any other group or even tab and I'm going to make these three by two and see how that looks.
I can always change it later for the label.
I'm going to see Button.
State and let's choose this layout.
All right.
And deploy and see what happens.
So here is the button, it's blue text of white background.
Here is the button state text output.
Click on it and you can see that now button state shows that the button was clicked, but they can't
unclick it.
That's not what I expect from a momentary button.
I'd like it to be able to detect when a button is clicked and then either immediately show that the
button is unclipped or at least after a couple of seconds to reset itself back to unclick state.
At least the message that I get here should be unclipped.
So to do that, I will need to introduce another node, which is see the top.
It's a trigger note right here, so I'm going to grab one of those and put them up and put the trigger
note in between the button and button state and connect them like this.
And what I want to do with this note is that I wanted to.
Sent the message clicked when input is received from the button itself, then let's say I'd like it
to wait for about one second.
And then sent a new message, not clicked.
Basically, this will reset the message that is displayed in the text output widget and create the effect
of the button resetting itself.
Imagine that whatever note you have in place of the text output note will receive the reset message
and act accordingly.
All right.
Now let's see how that works.
Actually, I'm going to give this a name reset button so that we know exactly what it does by just by
looking at it in the flow.
So deploy and then back into the dashboard.
I'm going to click on the button clicked and then a second letter not clicked.
Go.
All right, so this is how you can use the button, remember, that button will not reset automatically.
So if you want the button to reset after a small amount of time, then you need to use the trigger note
to make it through.
So let's move on to the next lecture.
We'll show you how to use the gauge.