Why we need to add Register in TriColor LED with Button?
Tutorial 6: <h4 class="page-title" style="font-family: Oswald; color: rgb(51, 51, 51); margin: 10px 0px 20px; font-size: 20px;">Arduino with Tricolor LED and Push-button - English</h4>
The video has an explanation but I am not able to understand why we need to use register between pin no 4 and Anode pin of LED.
Arduino Arduino-with-Tricolor-LED-and-Push-button 08-09 min 0-10 sec
When you configure any digital pin on arduino as input, it requires 5V supply to work any operations. When you press the push button, that pin gets the 5V supply it requires and the resistor connected to that pin makes sure that the current is not delivered to this pin immediately. The resistor is used to limit the current