LDR with LED

This code is much simpler than it seems. As always we started by declaring the variables: the port, the LED and the LDR. Next we created a void setup where we put the settings and the way in which the code will work, Analog. Finally we create a void Loop, which we will tell you with what intensity you have to go off, or depends how you put it on, that depends on whether you put it from more to less, or less to more, I encourage you to do it.

Video Example