In previous tutorial we learned how to interface a LED to Atmega328 and then wrote the code in Atmel Studio to make it go 'ON' and 'OFF' after every one second. In short we learned how to use our MCU's port pin as a simple digital output. In this tutorial we will be using a push button as an input to turn LED on for certain duration. Like last tutorial we will be using PORTB for our purpose. We will be using PB5(Pin 19) as output and PB1(Pin 15) as input. In this tutorial we will be using Current Sink method to interface LED with the mcu, whereas internal pullup method for interfacing the pushbutton. The following image shows the circuit we need to assemble. Schematic for Interfacing LED and Button What is Current Sinking? When the current flows from power supply to load and then to the Microcontroller's pin (or any other device) the configuration is called Current Sinking. In our circuit Power Supply is of 5V, LED is the Load and the
One spot for different micro-controllers...