Now we will control the LED depending on external input. In this tutorial we will interface a switch to one of the port pin and display its status on LED connected to other port.