AVR reads button state and indicates on LED
![](https://scienceprog.com/wp-content/uploads/2013/07/poles_of_LED-182x150.png)
This is a simple demo program of reading button state, lighting LEDs, sending information via USART. 8 buttons are connected to Atmega16 port A, 8 LEDs to port B via current limiting resistors. While none of the buttons aren’t pressed, there is a running light on LEDs performed, but when any of the buttons are pressed, LEDs display the current 8 bit counter value in binary format. The same value is sent via USART – you can see a number in the terminal is connected. The program is very simple: