Hello, guys, and welcome back.
We've talked about how can we read the status of these on and off buttons right here.
Well, since we are sending two different payloads, well, we don't really want to do that using this
on and off.
How about we let our not MCU send us the status of its own leadeth?
So how can we do that?
It's actually very simple inside this same interval based off portion of code.
We're going to read our Leidy's so we can simply create a valuable of a boolean.
I'm going to call it a stat or a status.
It's going to equal to digital read.
PIN number to PIN number two is the lady I am using and I am just reading it now, all I need to do
is just publish it.
So if I say here, I'm going to create a new topic and I'm going to call it led STATT.
OK, or status, let it be like this, and I'm going to send the evalu LSD status, OK, that's it.
This is all I need to do.
Now if I click on upload, this will also publish every three seconds while it is publishing and while
it is uploading, let us go and change the note right now.
This is my not right.
How about we create a new form.
Cute and just do the same thing.
I'm going to copy this whole thing and just modify it.
I don't need the numeric.
I need this unlooked values.
I'm going to double click on this.
But value, it's not about value anymore.
It's called Leidy status.
This is the topic we have chosen in the original sketch.
And here, instead of analog values, I'm going to call it Leidy's.
Status.
You can call it whatever you want.
Now I'm going to show you the last five minutes and the value is only between zero and not right, because
it's either an on again off.
No, I'm going to show you the difference between linear and step if I live it as linear.
Take a look what's going to happen.
I have deployed now this is the chart, let's say I'm turning it off and a of is high and on is low
grade because this is an active low, as we have talked about.
As you can see, it's giving me these triangles.
They are not really nice.
Let me give it another one.
Let it flow a little bit.
As I said, it's I don't really like this slop like this, this is why I'm going to go with Step.
If I click here and changed it from linear to Steib, click on Don Deploy.
Now, as you can see, it is visually better for a binary value.
Now I click on off on.
Remember, it's not instantaneous.
It's a jumping every three seconds.
If I change my value, it's not really affected and that's it.
We've done a really good job now in linking this not red with our not MCU, no matter what kind of sensor
is you have, no matter what kind of value you want to send, you can do it now.
We are sending digital.
We are sending analog.
Now, we learned how to send digital here and we have learned how to receive digital.
We have learned how to receive analog values.
How about we learn?
How can we send an analog value?
Now we have learned how we can send values, be digital or analog.
It's the same thing actually, and we have learned how we can receive and send analog as well.
Right.
So now, no matter what's the project you're having, you can actually easily link it to an object.