1
00:00:01,230 --> 00:00:02,080
Hello and welcome.

2
00:00:02,220 --> 00:00:03,000
This new lesson.

3
00:00:03,330 --> 00:00:11,160
Now the last part of coding is the low function and that all we need to check the state of the motion

4
00:00:11,160 --> 00:00:12,870
detected variable.

5
00:00:13,470 --> 00:00:15,120
So we'll use an if statement.

6
00:00:17,930 --> 00:00:20,240
F m, detective.

7
00:00:21,980 --> 00:00:25,670
Now, let's make sure that we have the right variable name.

8
00:00:30,030 --> 00:00:37,890
So as detected, if this is true, you cover up equal equal to or you can simply write it without anything.

9
00:00:38,880 --> 00:00:43,370
Now, if it is true, it means that motion is detected or rather defeated.

10
00:00:43,380 --> 00:00:51,150
So we need to send a new message to our Telegram box indicating that motion was detected.

11
00:00:51,690 --> 00:00:52,740
So inside here?

12
00:00:54,480 --> 00:00:57,600
We will use the bot deft send message.

13
00:00:59,680 --> 00:01:05,400
Just like here in the setup function, we will pass the Chuck I.D..

14
00:01:10,790 --> 00:01:15,380
Chad Ivey and we arrived the message motion.

15
00:01:18,060 --> 00:01:19,170
Being affected.

16
00:01:21,070 --> 00:01:24,330
And as an empty thank.

17
00:01:25,610 --> 00:01:31,160
Now, this will send a message now sending a message to the what is very simple.

18
00:01:31,640 --> 00:01:34,010
Send a message will take care of everything.

19
00:01:34,370 --> 00:01:36,620
You only need to pass the arguments.

20
00:01:36,620 --> 00:01:39,170
That is the chart in the message.

21
00:01:39,620 --> 00:01:42,180
The past the past moment is Atlantis.

22
00:01:43,340 --> 00:01:47,090
Now, once we do this, we need to.

23
00:01:49,700 --> 00:01:57,140
Set the motion evicted from true to false to make sure that we can receive any new detection, so false.

24
00:01:58,760 --> 00:02:07,730
This is everything now this methods were written a Boolean value, so we can create a new Boolean variable.

25
00:02:08,690 --> 00:02:10,100
So let's say result.

26
00:02:11,400 --> 00:02:11,970
If one.

27
00:02:13,590 --> 00:02:14,190
And.

28
00:02:15,670 --> 00:02:16,060
If.

29
00:02:18,550 --> 00:02:25,630
Resolve equal equal, or if a result is through, then you can send a serial.

30
00:02:27,560 --> 00:02:29,110
Friend and message.

31
00:02:31,290 --> 00:02:35,280
Message successfully sent.

32
00:02:36,810 --> 00:02:37,380
Else.

33
00:02:39,180 --> 00:02:40,830
We can't face the same cold.

34
00:02:43,110 --> 00:02:46,710
To indicate that her off message wasn't sent.

35
00:02:50,890 --> 00:02:51,520
So it's.

36
00:02:53,130 --> 00:02:54,300
And we can say.

37
00:02:58,550 --> 00:03:02,750
This means that the send message function didn't execute correctly.

38
00:03:03,110 --> 00:03:07,430
Now, if it did execute correctly, we will see this on our window.

39
00:03:07,670 --> 00:03:10,280
We can also send this message.

40
00:03:12,300 --> 00:03:20,120
Along also, this line with the same Sundance motion has been difficult, so this will be sent off in

41
00:03:20,120 --> 00:03:20,700
the go on board.

42
00:03:20,880 --> 00:03:24,810
This will be sent off the monitor now if that isn't.

43
00:03:26,150 --> 00:03:30,230
Of executing the send message function is through.

44
00:03:30,470 --> 00:03:35,570
Then we can easily indicate this by allowing this on the student monitor.

45
00:03:35,900 --> 00:03:42,140
Otherwise, we will print out error that this method was not executed correctly.

46
00:03:42,560 --> 00:03:43,040
That's it.

47
00:03:43,400 --> 00:03:47,780
And the next lesson we are going to try this practically.

48
00:03:47,840 --> 00:03:50,090
So stay tuned now.

49
00:03:51,610 --> 00:03:54,970
We need to compile our code to make sure that we don't have any rules.

50
00:03:56,080 --> 00:03:58,060
Now I can see that you have a spelling error.

51
00:03:58,240 --> 00:03:59,770
This is called our chatting.

52
00:04:01,530 --> 00:04:07,920
Our chat is not out, so this combined again once this is done.

53
00:04:10,970 --> 00:04:11,310
OK.

54
00:04:11,870 --> 00:04:13,070
This is the error.

55
00:04:14,150 --> 00:04:16,910
I have said the name of this variable.

56
00:04:26,790 --> 00:04:34,860
Now, as you can see done, combining the next item is uploading this code to our U.S. B-52 bomber to

57
00:04:34,860 --> 00:04:36,030
test this out.

58
00:04:36,600 --> 00:04:37,830
Thanks for watching this lesson.

59
00:04:38,190 --> 00:04:41,730
If you have any question involving anything inside this code, I'm here to help.

60
00:04:42,270 --> 00:04:45,150
This is Ashraf from educational engineering team.

