1
00:00:01,370 --> 00:00:10,370
And will come this new lesson, not going to start the coding process for our ISP 32 Telegram connection.

2
00:00:10,970 --> 00:00:14,690
So let's get started by starting the Arduino Ivy.

3
00:00:16,590 --> 00:00:21,750
Now, first, we need to create a new project, so click File New.

4
00:00:24,200 --> 00:00:26,820
Now, once you have a new project, you need to save it.

5
00:00:27,120 --> 00:00:29,910
So let's make find save as.

6
00:00:30,120 --> 00:00:32,730
And we need to save it in another location.

7
00:00:34,180 --> 00:00:42,130
Now, let's save it with yes, be Billy Graham books name now.

8
00:00:43,030 --> 00:00:50,950
The first step in any program is preparing by including the library that we are going to use.

9
00:00:51,220 --> 00:00:52,660
So let's first include.

10
00:00:54,930 --> 00:00:57,390
The adrenal JSON Library.

11
00:01:03,160 --> 00:01:07,960
We also need to include the Universal Telegram Bot Library.

12
00:01:16,430 --> 00:01:18,460
Let's I thought I bring him universal.

13
00:01:20,020 --> 00:01:28,330
Of both but in a fine, and we need to use the Wi-Fi libraries, so I include.

14
00:01:30,730 --> 00:01:32,620
Why find or take?

15
00:01:36,080 --> 00:01:43,190
And the last area that we need to use is the five secure who secured our Wi-Fi connections.

16
00:01:44,120 --> 00:01:45,050
So I find.

17
00:01:46,910 --> 00:01:47,330
Lionel?

18
00:01:49,730 --> 00:01:54,240
The cure that I find, so this part is basically.

19
00:01:56,160 --> 00:01:58,680
Including the required Bibles.

20
00:02:00,460 --> 00:02:06,190
Now, once you are done, we need to start creating the variables that we will use and our problem.

21
00:02:07,240 --> 00:02:12,490
So creating liability related variables.

22
00:02:13,710 --> 00:02:16,050
The first step is creating a constant.

23
00:02:17,650 --> 00:02:22,420
Character points out for this, this I.D., which is the name of our network.

24
00:02:24,180 --> 00:02:25,470
And you need to place.

25
00:02:27,760 --> 00:02:29,080
Your network?

26
00:02:31,360 --> 00:02:34,420
And when I say network, I mean, Wi-Fi network aside.

27
00:02:36,030 --> 00:02:36,330
It.

28
00:02:40,690 --> 00:02:41,920
That kind of thing going stop.

29
00:02:44,030 --> 00:02:45,490
Character password.

30
00:02:47,750 --> 00:02:54,130
And we also need to add our Wi-Fi passwords here.

31
00:02:56,470 --> 00:02:59,110
These two variables are for the Wi-Fi Library.

32
00:03:00,280 --> 00:03:00,730
Now.

33
00:03:03,310 --> 00:03:06,250
We need to create a few variables for the Telegram board.

34
00:03:06,550 --> 00:03:14,110
Now we know that the voters are talking and it requires our I.D. to make sure that it won't receive

35
00:03:14,560 --> 00:03:16,780
messages from anyone but us.

36
00:03:16,960 --> 00:03:18,520
So first, let's define.

37
00:03:20,420 --> 00:03:21,040
Are booked.

38
00:03:21,890 --> 00:03:22,390
Welcome.

39
00:03:24,060 --> 00:03:26,010
And we would add it between two.

40
00:03:28,330 --> 00:03:38,640
I say that regulation and we also need that Shark I.D. and this chart I.D. is basically yours to find

41
00:03:38,640 --> 00:03:46,260
out the top I.D. for individual or a group so that we can make sure that we will be the only one who

42
00:03:46,260 --> 00:03:48,210
is sending messages to this spot.

43
00:03:49,330 --> 00:03:50,050
So define.

44
00:03:51,430 --> 00:03:51,850
Chuck?

45
00:03:53,040 --> 00:03:53,370
I've.

46
00:03:55,700 --> 00:04:05,150
Now, the next step is creating an object from the Wi-Fi client CQ, so I find I want.

47
00:04:06,470 --> 00:04:08,500
Secured this network, Lawrence.

48
00:04:10,040 --> 00:04:22,250
Now we also need to call that boat function from the universal Telegram bots or universal drama box.

49
00:04:23,540 --> 00:04:26,180
But we will pass two variables.

50
00:04:27,210 --> 00:04:28,530
The first one is about.

51
00:04:30,040 --> 00:04:30,580
So can.

52
00:04:32,690 --> 00:04:36,320
Value, so let's change this for this.

53
00:04:37,910 --> 00:04:40,310
The chart idea or our.

54
00:04:43,570 --> 00:04:44,140
Shot it.

55
00:04:46,680 --> 00:04:48,840
So it will take two variables, though.

56
00:04:49,320 --> 00:04:56,430
OK, so now that Chart ID, that's a baby will be used an if statement, but we need to pass on other

57
00:04:56,430 --> 00:05:02,160
variables here to elaborate on that variable is our client.

58
00:05:02,400 --> 00:05:03,000
So.

59
00:05:05,680 --> 00:05:12,940
The clan name based here so that they're on board will take the token value on that day, and from all,

60
00:05:12,940 --> 00:05:13,900
it'll be fine, it work.

61
00:05:14,880 --> 00:05:17,880
And the next step will be.

62
00:05:19,210 --> 00:05:24,730
Assigning a value for the census, so let's create an instance.

63
00:05:27,620 --> 00:05:30,560
Integer for motion sensor.

64
00:05:33,980 --> 00:05:39,860
And we already connected it to Ben, no, let's say let me check here.

65
00:05:40,130 --> 00:05:41,870
And number two, why anyone?

66
00:05:45,900 --> 00:05:48,000
So this 21 year.

67
00:05:49,370 --> 00:05:55,580
And we already assigned the value for the temperature sensor.

68
00:05:57,130 --> 00:05:58,690
I think the value was

69
00:06:01,120 --> 00:06:02,080
34.

70
00:06:03,160 --> 00:06:03,480
OK.

71
00:06:05,050 --> 00:06:05,590
That's it.

72
00:06:05,710 --> 00:06:08,080
These are the Pins pin number.

73
00:06:11,400 --> 00:06:18,590
For motion sensors on this one is the pin number or temperature.

74
00:06:19,890 --> 00:06:20,280
Since.

75
00:06:21,980 --> 00:06:22,430
Now.

76
00:06:24,360 --> 00:06:26,040
We need to create a Boolean variable.

77
00:06:26,610 --> 00:06:30,870
This Boolean value will be used to indicate if a is evicted or not.

78
00:06:31,230 --> 00:06:32,320
So it will return.

79
00:06:32,340 --> 00:06:33,270
True or false?

80
00:06:33,840 --> 00:06:37,610
And will initialize it to a default value of fog's.

81
00:06:38,040 --> 00:06:41,490
It's like initializing a variable of integer to zero.

82
00:06:42,060 --> 00:06:46,680
So in here, right boolean detected.

83
00:06:48,980 --> 00:06:50,020
Equal false.

84
00:06:51,650 --> 00:06:54,740
This one is to indicate.

85
00:06:56,740 --> 00:06:58,870
If the motion is in effect, the.

86
00:07:00,500 --> 00:07:00,920
Now.

87
00:07:02,340 --> 00:07:04,800
Let's go inside the voice.

88
00:07:05,100 --> 00:07:13,050
Well done, like preparing our code now and the next lesson we will code after the function.

89
00:07:13,230 --> 00:07:15,930
So let's talk quick overview of what we have done here so far.

90
00:07:16,410 --> 00:07:18,330
We included the Arduino JSON library.

91
00:07:18,540 --> 00:07:24,360
We included the Universal Telegram Bot Library, the life-I libraries, all Wi-Fi or internet connection.

92
00:07:24,840 --> 00:07:30,180
We created this idea and password variables for the Wi-Fi network.

93
00:07:30,300 --> 00:07:36,510
This is the Wi-Fi network name and this is the password we created two defines.

94
00:07:37,230 --> 00:07:38,490
These are two macros.

95
00:07:39,000 --> 00:07:44,040
The first one is for the bot token value because everybody has its own token.

96
00:07:44,430 --> 00:07:51,990
The second one's for that shot is to make sure that the bot will only receive messages from us from

97
00:07:51,990 --> 00:07:52,740
our user ID.

98
00:07:53,550 --> 00:07:56,900
We created a client which is an object from the Wi-Fi client secure.

99
00:07:57,390 --> 00:08:02,820
We also created or called the bot function that takes two values.

100
00:08:03,150 --> 00:08:07,530
The first one is the bot token and the second one is the Wi-Fi network line.

101
00:08:08,550 --> 00:08:11,920
We created two variables for the sensors Motion Texas.

102
00:08:11,920 --> 00:08:19,830
Since all of English, our sensor, we created the variable to this variable, the motion depicted to

103
00:08:19,830 --> 00:08:27,750
indicate if a motion is detected or not, and give it an initial value of false and that this is Boolean.

104
00:08:29,240 --> 00:08:37,760
And the next lesson, we will program the setup function and place the unnecessary lines of code to

105
00:08:37,760 --> 00:08:40,310
make sure that all your life is connected.

106
00:08:40,820 --> 00:08:47,330
And next, we will program the loop function and setting the motion detection code and the temperature

107
00:08:47,330 --> 00:08:47,990
sensor code.

108
00:08:49,070 --> 00:08:50,420
Thanks for watching this lesson.

109
00:08:50,810 --> 00:08:53,570
This is our stuff from educational engineering team.
