Now that we have sent an email, we can configure this email to include sensitive data.
So what we need to do at this point is go back to our code.
Let's save it.
It's called it's called sense or email.
Now we have this code that we can edit.
What we need to do is to read the touch sensor to Arthur's Belt and our ISP board, you can use that
temperature sensor or any other type of sound, so just connect to the right pin now.
The first thing that we need to do is create a new variable.
Just make it integer and let's name attach value.
Now inside this method, we can.
Interview and take this variable, which has such value inside the loop.
And make it equal that actually its function.
And let's assume that we are using the touch sensor at PIN number for now to get the reading list printed
on serum letter serial that print on.
And let's print out.
The touch sensors value.
And the quotation, OK.
Next, let's add serial note print along.
And let's pass the torch value, OK, now that we have the social value, we can add a condition.
If statement, you can choose the very same thing for temperature sensors or any other type of sensor,
no, let's say the touch value
is above or equal to 100.
We need you to send us an email and we need to send the message in this email to be.
Let's hold this.
The school this year.
So we have a message to be.
And plain text.
Now, Sid, the message we need to write the touch sensor value.
Is above 100.
Now we want to see an email stating this after receiving the emails and a delay.
Now, let's make the lay 1000 second, then we need to make this, which is basically make sure that
we don't have any errors and.
And that a couple.
OK, let's go back here.
Now, what will happen here when we receive an email with this message, one essential value is above
100.
You can add a temperature sensor and if the sensor value is above 50, you can receive an email with
an alert to make sure that you know that is high temperature in that location, and you can check it
out.
After that, we are adding the recipient and we are sending the email with some TB data.
Then we are printing this and the sheer amount of we have on error.
Then we are emptying that empty b that that's it.
This is how you can send an email.
Let's commend this section and our code.
Now, let's test this out to make sure that it works.
You can move all of these to the Void law section.
So let's move them, let's copy all of this.
And pasted above this line.
Here.
Now we have the details, we have an email.
The sender of the priority and the email subject, we are reading the essential value and you are printing
of sense of value on the serial monitor.
Then we are checking if the sensor values above 100 or equal 100, then we are sending a message, an
email message and let us command this pass from here.
Add this to comment.
OK, now let's verify the code and upload it to our EOS people.
I will hook up my board to my ISP.
Well.
OK.
No DSP board does hooked up.
Now let's move on to now, let's upload our code to the ESB board that we just connected to make sure
that we are receiving this and solid data.
Now.
As you can see, the court is applauding the borders connecting through come for now.
It's applauding the accord that, yes, be memory.
Now than uploading.
That's it.
Now.
We need to make sure that we have.
The sensor reading.
Let's check that email to sure.
Okay.
We are receiving an email.
And as you can see, the touch sensor value is above 100, and I received the same email on my mobile
phone.
So the touch sensitive value in this case is above 100.
You can also send the touch sensitive value on the email itself.
It will be a very easy thing to do.
But this is the main point.
And we have a problem here, we received over 10 emails.
This is because in our code in the loop.
And so the root function, we only added 1000 1000 milliseconds, which is basically one second.
So we will keep receiving emails every second.
We can increase this number to be.
Like 10 or 100 seconds, then we calmly upload the code.
OK, now what I did here is basically I have seen the sentence, the touch sensor value is above 100
plus that that's value.
It will send the touch and sort of value with the email.
And I added 100 seconds between every email and the next one.
So let's check to see.
What we did receive.
OK.
Now, as you can see here, we are receiving their sense of value, it's a 99 and we didn't get that
line, which is the first sense of values above 100 because it's not above 100.
That's it.
This is basically how easily you can sense and sold data to your email or how to get an email alert
when the essential value goes above a certain value.
This that's it for this lesson.
If you have any question, please ask in the Q&A board, and the same approach can be done for them
ambitious and social distance or aren't any other type of sensor?
You can even create a simple code display, the sensor reading and on its way, graphical user interface
using batons, using text, gloves and other stuff.
Now again, if you have any question, you can ask it in on the aboard.
This is us from educational engineering team.