This is the part two. This is the fading led. So uh did you the only the led is the anode. I explained it in the previous video seeing the viper its the signal, its connected to analog pin a2. That is the again this i know whatever analog is analog contains more than well. This contains a lot of values. Lets just say that it can take a lot of values and notice connected to vivo five volt. Okay. So let me just using up five volts. The anode cathode is connected to ground because its always always is so uh. What is this? Finding define is like uh. The fine helps you to make sure you dont have to write in to set up anything because its only right to set up in anything because uh the define the final, explain everything and yeah its. Not a problem at all. So theyre gon na define, led pin for the already been digital pin. Four during the last last last video um, we did about uh digital, we did d4, so this is also it, and the fine pop pin pop pin so pop pin is actually pop. Pin is the pin of the potentiometer for 10 t o meter a potentiometer about 10 10 mm potentiometer is a its like a three terminal resistor that can control the volt that can control the voltage. Like a you know, those uh knobs of the doors uh weird circle wanted to just turn them around.

Well, uh. Those are the same things you just you have to turn them around. If you turn it to the left or right, it may increase or decrease. So technically its a kind of like those uh switches on the fans like you can control the temper to control the speeds. Speed of it in yeah, pin is connect and the reason were connecting it to a2 collision. Analog, pin and open e2 is right, uh, its very close to it so yeah. So the setup nothing happens in the setup and then the loop and were gon na need the loop. Otherwise, if were gon na make it uh were gon na, add no loop in it. Uh only thats for, like like say its one, try and then gon na get one treasure ill have to use loop for this, and int is the variable so uh, so heres a pot value the value. Okay, so uh, im going to use part value. Part value is the value of the potentiometer, because it has like a. It is a three term, its defined as a three terminal variable resistor, so uh were going to use analog, read because uh and like, as we said before, analog has more variables, but one more thing that we havent discussed is that uh using we read because were Controlling the thing controlling it, so thats, what were using to read im going to mention that in the last last video im going to bracket part pin.

Why? Because uh it says define popping so its like the. If you have done javascript, you understand what this means. So popping is like the its like: a function, something like that so yeah. So apparently a pop pin is the you can say variable and its connected, so thats. Why right now im popping because this is the value of the potentiometer, so int fade value. What is 40 random fade value, fading values for fitting the led remember when we said that uh analog is more than one value as well. It has a lot of other values, but uh this time and something i did wrong in the last video was about. The analog of the right thing right is for like uh entering the values greed is just taking in like, for example, youre writing a book. You are entering the information in it, and library is somebody reading it so yeah. I guess its something like that. The fade value, the fading of it uh winning them fade value means, but you cant do well. You cant do this with the director. One were using analog because it has many values like uh, like i said like three times before. I guess so. Uh were going to use a fade value and youre going to equal to map the part value. So we wrote a little popped value here. So i can change the value from 0 to one zero. Three two three then zero, then two, two two five five, so its a solid surgery, its a maps.

Mass of you right now part value because uh it is the controller thats. Why so, then right, then we find analog right. You see so then analog right. We write down, led, pin and fade value. Why? Because were connecting it to the led and were adding the fade value were supposed to uh make the led pin have the fade, make the led fade. Thats right right now led pin fade value. The delay will be of 30 30, like 30 equal to 30 milliseconds. For the gym to see the dimming effect well uh, so anyway, im gon na try running it now wait a minute again, i dont have the camera. So i im just going to tell you whats happening. So: okay ive opened up my ordinal set. So when i turn my potentiometer stick, 10 0 meter stick to the right it to my right. Apparently it uh of the uh bulb led. Then, when we turn it back, it lights back up, but you cant see the blink. You cant see the fading technically because it is a very small delay, so yeah its not really fleeting its blinking but uh. Well, so yeah so thats pretty much it so i hope i get uh hope this homework hope i got most of the things uh correct.

https://www.youtube.com/watch?v=yV7nC9TGHBQ