//
//
// Button.LED.c
//     

#include <avr/io.h>
#include <util/delay.h>  


int main(void) {

//button
  DDRA &= (1<<PA3);
  PORTA |= (1<<PA3);

//LED
  DDRA |= (1<<PA7);
  PORTA |= (1<<PA7);

  while (1) {

	if (PINA & (1<<PA3)) { //button is not pressed
	    PORTA &= ~(1<<PA7);//turn LED off
  	 
	} 
	else {
	  _delay_ms(10);	

	if ((PINA & (1<<PA3)) == 0) { //button is pressed
    	PORTA |= (1<<PA7);//turn LED on	
  		 }
 	 }
    }
}
