And now that you have added your photoresistor to your annual secret, let's see how to get some values
from it.
So that is super, super easy here.
We don't need any library to read from the scene, so we just need to use the analog grade function.
So first, I'm going to define a photo register.
Being, which is a zero, so make sure this is an honor to in this setup to remove that, I don't need
to use spin mode because this is already an analog input being.
OK, if you'll remember, from the analog pings section.
So Nossiter and in the loop, if I want to get disvalue, I just do analog read with the photoresistor
thing and I get the video so I know what I'm going to do.
I'm just going to print it so that Biggin.
OK, I'm just going to put that inside, so, yeah, that's right, and so we can monitor it.
And then for the sake of this example, I'm going to add a delay of one hundred, OK, that I'm, of
course, not going to use when we do the following activities and final project.
But here we just want to test one thing quick.
So let's just add a small delay.
And that's really not the problem here.
So I'm going to upload now the code to the original, let's name it to the stop.
And let's open the Syrian money to oil and let's see what we get here so we can some values.
Three hundred seventy, 60, 80 something.
OK, so this is the actual measurement of the SENSEOR.
So between zero, which is the minimum, which is completely dark, and one thousand twenty three,
which should be completely like one hundred percent light.
So now if I put my hand on something on top of the sensor so you can see the luminosity is reduced and
what we are going to right now is 40 something, so it doesn't go to zero.
OK, as you can see, the value here is not zero.
Is 40 something that that's the minimum I can get basically here it seems.
So I remove my hand and no, we are going back to three hundred sixty something.
I'm going to add some more lights to the room.
OK, just OK right now.
And you can see now we are at seven hundred fifty something so I'm going to turn off the light and we
are going back to three hundred seventy.
So the value you get here, just values, then you need to interpret them.
So now it would be up to you to define actually what values correspond to what.
OK, so what you can do is try in your own government when you have a full light, see what is the value
you get and then try it with a low light.
Maybe try at night, OK, if you want to measure outside and try outside, OK.
And just note the different values you get for different threshold.
So then you will be able to create some defines for the thresholds you want.
So in your code you can compare the value you get with those threshold and that's what we are going
to do.
So in the following activities, so to recap, to use the photoresistor or you just use it with another
great function, that's it.
You get a value between zero and one thousand twenty three and then you can test this sense in different
under different luminosities and interpret the values you get to define some thresholds, for example,
to put on an entity or to start another actions and what we can do.
So in the 80s, use the sale plotter.
OK, so that's quite convenient here.
You can see I have my authority store.
I put my hand on top of it and then I remove it so you can see the evolution of the value.