Complete circuit schematic
Here, you have the complete circuit schematic for this example. As you can see, the connection point between the switch and the resistor is connected to the Arduino pin number 7 in this example, and we will use pin number 9 as an output to connect the LED that we will use to blink or fade.
Given that we will deal with the LED as a digital or analog device up to the pressing of the button, we have to connect it to the Arduino board through any of the PWM pins that will allow us to use it with the digitalWrite()
or analogWrite()
functions.
The only consideration to be made about this circuit is regarding the right connection of the momentary button we will use, and we have talked about this in the previous paragraph.