1
00:00:00,690 --> 00:00:05,970
In this lecture, I'll show you how to use the button, so it's a very simple device, obviously, but

2
00:00:05,970 --> 00:00:13,680
it's a little tricky to get it to work in a way that a momentary button, at least, is supposed to

3
00:00:13,680 --> 00:00:13,920
work.

4
00:00:13,950 --> 00:00:15,060
So let me demonstrate.

5
00:00:15,370 --> 00:00:21,960
I'm going to place the button in the same tab and group as the one that we used in the previous lecture

6
00:00:22,290 --> 00:00:24,930
where we played with a text input and output.

7
00:00:25,500 --> 00:00:32,070
So first I'm going to pick a button from the dashboard category of nodes.

8
00:00:32,490 --> 00:00:34,020
There it is right here.

9
00:00:35,070 --> 00:00:43,200
And to show us the state of the button, I'm simply going to use a text output node and connect the

10
00:00:43,200 --> 00:00:45,270
two directly like that.

11
00:00:46,410 --> 00:00:51,900
Let's have a look inside the button edit tab and you'll see that for the group.

12
00:00:51,900 --> 00:00:56,930
I'm going to assign it to have one group, one for this size.

13
00:00:56,940 --> 00:01:04,500
Let's make it three by one to begin with and see if that fits with the rest of the widgets in the group.

14
00:01:04,980 --> 00:01:12,180
And I also want to give it an icon, a hand I can hinter pointing down for the label.

15
00:01:13,080 --> 00:01:14,940
Just going to type in.

16
00:01:16,360 --> 00:01:24,170
Press me like that, and I'm going to leave the color and background, actually for the color.

17
00:01:24,190 --> 00:01:26,320
I'm going to make it blue.

18
00:01:27,310 --> 00:01:34,660
I'm going to have a blue background blue button in white background.

19
00:01:36,040 --> 00:01:44,230
Now, when I click on the button, I want the button to send the text clicked to whatever follows in

20
00:01:44,230 --> 00:01:53,620
these cases, the text output node and click on done for the text output.

21
00:01:54,820 --> 00:02:02,080
Again, I'm going to assign the text output again to tab one group one, although I can assign it to

22
00:02:02,080 --> 00:02:08,680
any other group or even tab and I'm going to make these three by two and see how that looks.

23
00:02:08,880 --> 00:02:12,030
I can always change it later for the label.

24
00:02:12,030 --> 00:02:13,390
I'm going to see Button.

25
00:02:15,510 --> 00:02:19,950
State and let's choose this layout.

26
00:02:20,310 --> 00:02:21,000
All right.

27
00:02:23,030 --> 00:02:25,520
And deploy and see what happens.

28
00:02:25,820 --> 00:02:30,010
So here is the button, it's blue text of white background.

29
00:02:30,020 --> 00:02:33,020
Here is the button state text output.

30
00:02:33,330 --> 00:02:39,570
Click on it and you can see that now button state shows that the button was clicked, but they can't

31
00:02:39,590 --> 00:02:40,250
unclick it.

32
00:02:41,060 --> 00:02:44,780
That's not what I expect from a momentary button.

33
00:02:44,780 --> 00:02:52,310
I'd like it to be able to detect when a button is clicked and then either immediately show that the

34
00:02:52,310 --> 00:02:59,240
button is unclipped or at least after a couple of seconds to reset itself back to unclick state.

35
00:02:59,420 --> 00:03:02,600
At least the message that I get here should be unclipped.

36
00:03:03,260 --> 00:03:12,050
So to do that, I will need to introduce another node, which is see the top.

37
00:03:13,630 --> 00:03:19,750
It's a trigger note right here, so I'm going to grab one of those and put them up and put the trigger

38
00:03:20,410 --> 00:03:26,200
note in between the button and button state and connect them like this.

39
00:03:27,880 --> 00:03:32,470
And what I want to do with this note is that I wanted to.

40
00:03:33,730 --> 00:03:43,420
Sent the message clicked when input is received from the button itself, then let's say I'd like it

41
00:03:43,420 --> 00:03:45,460
to wait for about one second.

42
00:03:46,650 --> 00:03:50,890
And then sent a new message, not clicked.

43
00:03:51,230 --> 00:04:01,560
Basically, this will reset the message that is displayed in the text output widget and create the effect

44
00:04:01,830 --> 00:04:04,060
of the button resetting itself.

45
00:04:04,200 --> 00:04:12,150
Imagine that whatever note you have in place of the text output note will receive the reset message

46
00:04:12,300 --> 00:04:13,980
and act accordingly.

47
00:04:14,760 --> 00:04:15,240
All right.

48
00:04:15,240 --> 00:04:17,390
Now let's see how that works.

49
00:04:17,400 --> 00:04:27,900
Actually, I'm going to give this a name reset button so that we know exactly what it does by just by

50
00:04:27,900 --> 00:04:29,630
looking at it in the flow.

51
00:04:30,030 --> 00:04:32,710
So deploy and then back into the dashboard.

52
00:04:32,730 --> 00:04:36,960
I'm going to click on the button clicked and then a second letter not clicked.

53
00:04:38,810 --> 00:04:39,080
Go.

54
00:04:41,580 --> 00:04:48,240
All right, so this is how you can use the button, remember, that button will not reset automatically.

55
00:04:48,250 --> 00:04:55,440
So if you want the button to reset after a small amount of time, then you need to use the trigger note

56
00:04:55,620 --> 00:04:56,250
to make it through.

57
00:04:56,280 --> 00:04:59,040
So let's move on to the next lecture.

58
00:04:59,070 --> 00:05:00,590
We'll show you how to use the gauge.
