1
00:00:02,490 --> 00:00:08,070
Now that we have sent an email, we can configure this email to include sensitive data.

2
00:00:08,880 --> 00:00:12,420
So what we need to do at this point is go back to our code.

3
00:00:13,740 --> 00:00:14,670
Let's save it.

4
00:00:16,990 --> 00:00:20,590
It's called it's called sense or email.

5
00:00:22,330 --> 00:00:24,940
Now we have this code that we can edit.

6
00:00:26,680 --> 00:00:33,070
What we need to do is to read the touch sensor to Arthur's Belt and our ISP board, you can use that

7
00:00:33,070 --> 00:00:39,010
temperature sensor or any other type of sound, so just connect to the right pin now.

8
00:00:41,440 --> 00:00:44,650
The first thing that we need to do is create a new variable.

9
00:00:44,870 --> 00:00:49,660
Just make it integer and let's name attach value.

10
00:00:51,160 --> 00:00:57,280
Now inside this method, we can.

11
00:00:59,420 --> 00:01:06,980
Interview and take this variable, which has such value inside the loop.

12
00:01:09,010 --> 00:01:12,970
And make it equal that actually its function.

13
00:01:13,700 --> 00:01:21,550
And let's assume that we are using the touch sensor at PIN number for now to get the reading list printed

14
00:01:21,560 --> 00:01:25,580
on serum letter serial that print on.

15
00:01:28,160 --> 00:01:30,230
And let's print out.

16
00:01:34,040 --> 00:01:38,180
The touch sensors value.

17
00:01:43,300 --> 00:01:45,360
And the quotation, OK.

18
00:01:46,660 --> 00:01:51,130
Next, let's add serial note print along.

19
00:01:53,510 --> 00:02:02,300
And let's pass the torch value, OK, now that we have the social value, we can add a condition.

20
00:02:03,730 --> 00:02:13,090
If statement, you can choose the very same thing for temperature sensors or any other type of sensor,

21
00:02:13,570 --> 00:02:15,850
no, let's say the touch value

22
00:02:18,550 --> 00:02:20,980
is above or equal to 100.

23
00:02:21,820 --> 00:02:29,110
We need you to send us an email and we need to send the message in this email to be.

24
00:02:30,680 --> 00:02:32,480
Let's hold this.

25
00:02:34,850 --> 00:02:35,900
The school this year.

26
00:02:38,170 --> 00:02:40,720
So we have a message to be.

27
00:02:43,650 --> 00:02:44,820
And plain text.

28
00:02:55,310 --> 00:03:04,580
Now, Sid, the message we need to write the touch sensor value.

29
00:03:06,700 --> 00:03:09,370
Is above 100.

30
00:03:10,690 --> 00:03:16,810
Now we want to see an email stating this after receiving the emails and a delay.

31
00:03:22,970 --> 00:03:32,000
Now, let's make the lay 1000 second, then we need to make this, which is basically make sure that

32
00:03:32,000 --> 00:03:34,640
we don't have any errors and.

33
00:03:36,230 --> 00:03:39,110
And that a couple.

34
00:03:42,350 --> 00:03:43,790
OK, let's go back here.

35
00:03:49,350 --> 00:03:54,330
Now, what will happen here when we receive an email with this message, one essential value is above

36
00:03:54,330 --> 00:03:54,840
100.

37
00:03:55,200 --> 00:04:02,010
You can add a temperature sensor and if the sensor value is above 50, you can receive an email with

38
00:04:02,010 --> 00:04:07,560
an alert to make sure that you know that is high temperature in that location, and you can check it

39
00:04:07,560 --> 00:04:07,890
out.

40
00:04:08,520 --> 00:04:15,450
After that, we are adding the recipient and we are sending the email with some TB data.

41
00:04:16,980 --> 00:04:21,900
Then we are printing this and the sheer amount of we have on error.

42
00:04:22,500 --> 00:04:26,970
Then we are emptying that empty b that that's it.

43
00:04:27,450 --> 00:04:30,100
This is how you can send an email.

44
00:04:30,100 --> 00:04:32,700
Let's commend this section and our code.

45
00:04:35,310 --> 00:04:38,220
Now, let's test this out to make sure that it works.

46
00:04:38,880 --> 00:04:42,540
You can move all of these to the Void law section.

47
00:04:44,330 --> 00:04:47,030
So let's move them, let's copy all of this.

48
00:04:48,210 --> 00:04:52,530
And pasted above this line.

49
00:04:53,670 --> 00:04:54,120
Here.

50
00:04:57,620 --> 00:05:01,270
Now we have the details, we have an email.

51
00:05:01,500 --> 00:05:07,770
The sender of the priority and the email subject, we are reading the essential value and you are printing

52
00:05:07,770 --> 00:05:10,370
of sense of value on the serial monitor.

53
00:05:10,730 --> 00:05:18,810
Then we are checking if the sensor values above 100 or equal 100, then we are sending a message, an

54
00:05:18,810 --> 00:05:23,120
email message and let us command this pass from here.

55
00:05:24,560 --> 00:05:27,070
Add this to comment.

56
00:05:27,920 --> 00:05:32,720
OK, now let's verify the code and upload it to our EOS people.

57
00:05:34,040 --> 00:05:36,890
I will hook up my board to my ISP.

58
00:05:38,100 --> 00:05:38,370
Well.

59
00:05:39,840 --> 00:05:40,290
OK.

60
00:05:40,330 --> 00:05:42,270
No DSP board does hooked up.

61
00:05:43,020 --> 00:05:52,380
Now let's move on to now, let's upload our code to the ESB board that we just connected to make sure

62
00:05:52,380 --> 00:05:54,420
that we are receiving this and solid data.

63
00:05:55,320 --> 00:05:55,800
Now.

64
00:05:57,310 --> 00:06:04,300
As you can see, the court is applauding the borders connecting through come for now.

65
00:06:04,780 --> 00:06:09,010
It's applauding the accord that, yes, be memory.

66
00:06:11,410 --> 00:06:12,770
Now than uploading.

67
00:06:13,090 --> 00:06:13,720
That's it.

68
00:06:14,930 --> 00:06:15,410
Now.

69
00:06:16,840 --> 00:06:18,850
We need to make sure that we have.

70
00:06:20,010 --> 00:06:21,270
The sensor reading.

71
00:06:23,310 --> 00:06:25,520
Let's check that email to sure.

72
00:06:27,410 --> 00:06:27,780
Okay.

73
00:06:29,130 --> 00:06:30,960
We are receiving an email.

74
00:06:33,710 --> 00:06:39,620
And as you can see, the touch sensor value is above 100, and I received the same email on my mobile

75
00:06:39,620 --> 00:06:40,070
phone.

76
00:06:40,490 --> 00:06:43,610
So the touch sensitive value in this case is above 100.

77
00:06:43,940 --> 00:06:47,660
You can also send the touch sensitive value on the email itself.

78
00:06:48,950 --> 00:06:51,380
It will be a very easy thing to do.

79
00:06:52,280 --> 00:06:53,840
But this is the main point.

80
00:06:54,050 --> 00:06:57,140
And we have a problem here, we received over 10 emails.

81
00:06:57,920 --> 00:07:00,680
This is because in our code in the loop.

82
00:07:01,760 --> 00:07:08,720
And so the root function, we only added 1000 1000 milliseconds, which is basically one second.

83
00:07:09,080 --> 00:07:11,840
So we will keep receiving emails every second.

84
00:07:12,590 --> 00:07:14,450
We can increase this number to be.

85
00:07:16,090 --> 00:07:20,170
Like 10 or 100 seconds, then we calmly upload the code.

86
00:07:22,210 --> 00:07:29,920
OK, now what I did here is basically I have seen the sentence, the touch sensor value is above 100

87
00:07:30,460 --> 00:07:32,040
plus that that's value.

88
00:07:32,050 --> 00:07:35,000
It will send the touch and sort of value with the email.

89
00:07:36,040 --> 00:07:42,430
And I added 100 seconds between every email and the next one.

90
00:07:43,120 --> 00:07:45,880
So let's check to see.

91
00:07:47,290 --> 00:07:48,580
What we did receive.

92
00:07:51,080 --> 00:07:51,470
OK.

93
00:07:53,440 --> 00:08:00,690
Now, as you can see here, we are receiving their sense of value, it's a 99 and we didn't get that

94
00:08:00,820 --> 00:08:06,390
line, which is the first sense of values above 100 because it's not above 100.

95
00:08:07,600 --> 00:08:08,230
That's it.

96
00:08:08,440 --> 00:08:16,390
This is basically how easily you can sense and sold data to your email or how to get an email alert

97
00:08:16,390 --> 00:08:19,450
when the essential value goes above a certain value.

98
00:08:20,250 --> 00:08:21,560
This that's it for this lesson.

99
00:08:21,580 --> 00:08:28,710
If you have any question, please ask in the Q&amp;A board, and the same approach can be done for them

100
00:08:28,710 --> 00:08:32,050
ambitious and social distance or aren't any other type of sensor?

101
00:08:32,380 --> 00:08:40,420
You can even create a simple code display, the sensor reading and on its way, graphical user interface

102
00:08:40,900 --> 00:08:44,530
using batons, using text, gloves and other stuff.

103
00:08:46,540 --> 00:08:50,710
Now again, if you have any question, you can ask it in on the aboard.

104
00:08:50,800 --> 00:08:53,020
This is us from educational engineering team.
